StochTree 0.0.1
|
Data structure that tracks pre-sorted feature values through a tree's split lifecycle. More...
#include <partition_tracker.h>
Public Member Functions | |
void | SplitFeature (Eigen::MatrixXd &covariates, int32_t node_id, int32_t feature_index, TreeSplit &split) |
Split numeric / ordered categorical feature and update sort indices. | |
void | SplitFeatureNumeric (Eigen::MatrixXd &covariates, int32_t node_id, int32_t feature_index, double split_value) |
Split numeric / ordered categorical feature and update sort indices. | |
void | SplitFeatureCategorical (Eigen::MatrixXd &covariates, int32_t node_id, int32_t feature_index, std::vector< std::uint32_t > const &category_list) |
Split unordered categorical feature and update sort indices. | |
data_size_t | NodeBegin (int32_t node_id) |
Start position of node indexed by node_id. | |
data_size_t | NodeEnd (int32_t node_id) |
End position of node indexed by node_id. | |
data_size_t | NodeSize (int32_t node_id) |
Size (in observations) of node indexed by node_id. | |
std::vector< data_size_t > | NodeIndices (int node_id) |
Data indices for a given node. | |
data_size_t | SortIndex (data_size_t j) |
Feature sort index j. | |
FeatureType | GetFeatureType () |
Feature type. | |
void | UpdateObservationMapping (int node_id, int tree_id, SampleNodeMapper *sample_node_mapper) |
Update SampleNodeMapper for all the observations in node_id. | |
Public Attributes | |
std::vector< data_size_t > | feature_sort_indices_ |
Feature sort indices. | |
Data structure that tracks pre-sorted feature values through a tree's split lifecycle.
This class is initialized from a FeaturePresortRoot which has computed the sort indices for a given feature over the entire dataset, so that sorting is not necessary for each new tree.
When a split is made, this class handles sifting for each feature, so that the presorted feature values available at each node are easily queried.