tree node
More...
#include <tree.h>
tree node
Definition at line 22 of file tree.h.
bool has_leaf_vector |
( |
| ) |
const |
|
inline |
- Returns
- tests whether leaf node has a non-empty leaf vector
Definition at line 63 of file tree.h.
- Returns
- get leaf value of leaf node
Definition at line 50 of file tree.h.
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 57 of file tree.h.
void set_categorical_split |
( |
unsigned |
split_index, |
|
|
bool |
default_left, |
|
|
const std::vector< uint8_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 119 of file tree.h.
set the leaf value of the node
- Parameters
-
Definition at line 132 of file tree.h.
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 143 of file tree.h.
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 102 of file tree.h.
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 154 of file tree.h.
- Returns
- get threshold of the node
Definition at line 67 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.1rc1/include/treelite/tree.h