tree node
More...
#include <tree.h>
tree node
Definition at line 26 of file tree.h.
◆ has_leaf_vector()
bool has_leaf_vector |
( |
| ) |
const |
|
inline |
- Returns
- tests whether leaf node has a non-empty leaf vector
Definition at line 67 of file tree.h.
◆ leaf_value()
- Returns
- get leaf value of leaf node
Definition at line 54 of file tree.h.
◆ leaf_vector()
const std::vector<tl_float>& leaf_vector |
( |
| ) |
const |
|
inline |
- Returns
- get leaf vector of leaf node; useful for multi-class random forest classifier
Definition at line 61 of file tree.h.
◆ set_categorical_split()
void set_categorical_split |
( |
unsigned |
split_index, |
|
|
bool |
default_left, |
|
|
bool |
missing_category_to_zero, |
|
|
const std::vector< uint32_t > & |
left_categories |
|
) |
| |
|
inline |
create a categorical split
- Parameters
-
split_index | feature index to split |
threshold | threshold value |
default_left | the default direction when feature is unknown |
cmp | comparison operator to compare between feature value and threshold |
Definition at line 152 of file tree.h.
◆ set_data_count()
void set_data_count |
( |
size_t |
data_count | ) |
|
|
inline |
set the data count of the node
- Parameters
-
Definition at line 195 of file tree.h.
◆ set_gain()
void set_gain |
( |
double |
gain | ) |
|
|
inline |
set the gain value of the node
- Parameters
-
Definition at line 202 of file tree.h.
◆ set_leaf()
set the leaf value of the node
- Parameters
-
Definition at line 167 of file tree.h.
◆ set_leaf_vector()
void set_leaf_vector |
( |
const std::vector< tl_float > & |
leaf_vector | ) |
|
|
inline |
set the leaf vector of the node; useful for multi-class random forest classifier
- Parameters
-
Definition at line 178 of file tree.h.
◆ set_numerical_split()
void set_numerical_split |
( |
unsigned |
split_index, |
|
|
tl_float |
threshold, |
|
|
bool |
default_left, |
|
|
Operator |
cmp |
|
) |
| |
|
inline |
create a numerical split
- Parameters
-
split_index | feature index to split |
threshold | threshold value |
default_left | the default direction when feature is unknown |
cmp | comparison operator to compare between feature value and threshold |
Definition at line 135 of file tree.h.
◆ set_parent()
void set_parent |
( |
int |
pidx, |
|
|
bool |
is_left_child = true |
|
) |
| |
|
inline |
set parent of the node
- Parameters
-
pidx | node id of the parent |
is_left_child | whether the node is left child or not |
Definition at line 210 of file tree.h.
◆ set_sum_hess()
void set_sum_hess |
( |
double |
sum_hess | ) |
|
|
inline |
set the hessian sum of the node
- Parameters
-
Definition at line 188 of file tree.h.
◆ threshold()
- Returns
- get threshold of the node
Definition at line 71 of file tree.h.
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/treelite/checkouts/0.91/include/treelite/tree.h