Skip to main content

Module predict

Module predict 

Source
Available on crate feature alloc only.
Expand description

Cache-optimized tree traversal for prediction.

Standalone functions that operate on a TreeArena for traversal, prediction, and structural queries. These are decoupled from crate::tree::StreamingTree so they can be reused by the ensemble layer and tested independently.

Functions§

collect_leaves
Collect every leaf NodeId reachable from root via depth-first traversal.
predict_batch
Batch prediction: compute the leaf value for each row in feature_matrix.
predict_from_root
Predict the leaf value for a single feature vector, starting from root.
traverse_to_leaf
Traverse the tree from the given root to a leaf, returning the leaf’s NodeId.
tree_depth
Compute the maximum depth of any leaf reachable from root.