Classes / functions for creating and modifying decision trees.
More...
|
bool | StochTree::operator== (const Tree &lhs, const Tree &rhs) |
| Comparison operator for trees.
|
|
bool | StochTree::SplitTrueNumeric (double fvalue, double threshold) |
| Determine whether an observation produces a "true" value in a numeric split node.
|
|
bool | StochTree::SplitTrueCategorical (double fvalue, std::vector< std::uint32_t > const &category_list) |
| Determine whether an observation produces a "true" value in a categorical split node.
|
|
int | StochTree::NextNodeNumeric (double fvalue, double threshold, int left_child, int right_child) |
| Return left or right node id based on a numeric split.
|
|
int | StochTree::NextNodeCategorical (double fvalue, std::vector< std::uint32_t > const &category_list, int left_child, int right_child) |
| Return left or right node id based on a categorical split.
|
|
int | StochTree::EvaluateTree (Tree const &tree, Eigen::MatrixXd &data, int row) |
|
int | StochTree::EvaluateTree (Tree const &tree, Eigen::Map< Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > > &data, int row) |
|
bool | StochTree::RowSplitLeft (Eigen::MatrixXd &covariates, int row, int split_index, double split_value) |
| Determine whether a given observation is "true" at a split proposed by split_index and split_value.
|
|
bool | StochTree::RowSplitLeft (Eigen::MatrixXd &covariates, int row, int split_index, std::vector< std::uint32_t > const &category_list) |
| Determine whether a given observation is "true" at a split proposed by split_index and split_value.
|
|
Classes / functions for creating and modifying decision trees.
Design
◆ SplitTrueNumeric()
bool StochTree::SplitTrueNumeric |
( |
double |
fvalue, |
|
|
double |
threshold |
|
) |
| |
|
inline |
Determine whether an observation produces a "true" value in a numeric split node.
- Parameters
-
fvalue | Value of the split feature for the observation |
threshold | Value of the numeric split threshold at the node |
left_child | Node id of the left child |
right_child | Node id of the right child |
◆ SplitTrueCategorical()
bool StochTree::SplitTrueCategorical |
( |
double |
fvalue, |
|
|
std::vector< std::uint32_t > const & |
category_list |
|
) |
| |
|
inline |
Determine whether an observation produces a "true" value in a categorical split node.
- Parameters
-
fvalue | Value of the split feature for the observation |
category_list | Category indices that route an observation to the left child |
left_child | Node id of the left child |
right_child | Node id of the right child |
◆ NextNodeNumeric()
int StochTree::NextNodeNumeric |
( |
double |
fvalue, |
|
|
double |
threshold, |
|
|
int |
left_child, |
|
|
int |
right_child |
|
) |
| |
|
inline |
Return left or right node id based on a numeric split.
- Parameters
-
fvalue | Value of the split feature for the observation |
threshold | Value of the numeric split threshold at the node |
left_child | Node id of the left child |
right_child | Node id of the right child |
◆ NextNodeCategorical()
int StochTree::NextNodeCategorical |
( |
double |
fvalue, |
|
|
std::vector< std::uint32_t > const & |
category_list, |
|
|
int |
left_child, |
|
|
int |
right_child |
|
) |
| |
|
inline |
Return left or right node id based on a categorical split.
- Parameters
-
fvalue | Value of the split feature for the observation |
category_list | Category indices that route an observation to the left child |
left_child | Node id of the left child |
right_child | Node id of the right child |
◆ EvaluateTree() [1/2]
int StochTree::EvaluateTree |
( |
Tree const & |
tree, |
|
|
Eigen::MatrixXd & |
data, |
|
|
int |
row |
|
) |
| |
|
inline |
Determine the node at which a tree places a given observation
- Parameters
-
tree | Tree object used for prediction |
data | Dataset used for prediction |
row | Row indexing the prediction observation |
◆ EvaluateTree() [2/2]
int StochTree::EvaluateTree |
( |
Tree const & |
tree, |
|
|
Eigen::Map< Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > > & |
data, |
|
|
int |
row |
|
) |
| |
|
inline |
Determine the node at which a tree places a given observation
- Parameters
-
tree | Tree object used for prediction |
data | Dataset used for prediction |
row | Row indexing the prediction observation |
◆ RowSplitLeft() [1/2]
bool StochTree::RowSplitLeft |
( |
Eigen::MatrixXd & |
covariates, |
|
|
int |
row, |
|
|
int |
split_index, |
|
|
double |
split_value |
|
) |
| |
|
inline |
Determine whether a given observation is "true" at a split proposed by split_index and split_value.
- Parameters
-
covariates | Dataset used for prediction |
row | Row indexing the prediction observation |
split_index | Column of new split |
split_value | Value defining the split |
◆ RowSplitLeft() [2/2]
bool StochTree::RowSplitLeft |
( |
Eigen::MatrixXd & |
covariates, |
|
|
int |
row, |
|
|
int |
split_index, |
|
|
std::vector< std::uint32_t > const & |
category_list |
|
) |
| |
|
inline |
Determine whether a given observation is "true" at a split proposed by split_index and split_value.
- Parameters
-
covariates | Dataset used for prediction |
row | Row indexing the prediction observation |
split_index | Column of new split |
category_list | Categories defining the split |