tree node
More...
#include <tree_model.h>
|
|
| Node (int32_t cleft, int32_t cright, int32_t parent, uint32_t split_ind, float split_cond, bool default_left) |
| |
|
XGBOOST_DEVICE int | LeftChild () const |
| | index of left child
|
| |
|
XGBOOST_DEVICE int | RightChild () const |
| | index of right child
|
| |
|
XGBOOST_DEVICE int | DefaultChild () const |
| | index of default child when feature is missing
|
| |
|
XGBOOST_DEVICE unsigned | SplitIndex () const |
| | feature index of split condition
|
| |
|
XGBOOST_DEVICE bool | DefaultLeft () const |
| | when feature is unknown, whether goes to left child
|
| |
|
XGBOOST_DEVICE bool | IsLeaf () const |
| | whether current node is leaf node
|
| |
| XGBOOST_DEVICE float | LeafValue () const |
| |
| XGBOOST_DEVICE SplitCondT | SplitCond () const |
| |
|
XGBOOST_DEVICE int | Parent () const |
| | get parent of the node
|
| |
|
XGBOOST_DEVICE bool | IsLeftChild () const |
| | whether current node is left child
|
| |
|
XGBOOST_DEVICE bool | IsDeleted () const |
| | whether this node is deleted
|
| |
|
XGBOOST_DEVICE bool | IsRoot () const |
| | whether current node is root
|
| |
| XGBOOST_DEVICE void | SetLeftChild (int nid) |
| | set the left child
|
| |
| XGBOOST_DEVICE void | SetRightChild (int nid) |
| | set the right child
|
| |
| XGBOOST_DEVICE void | SetSplit (unsigned split_index, SplitCondT split_cond, bool default_left=false) |
| | set split condition of current node
|
| |
| XGBOOST_DEVICE void | SetLeaf (bst_float value, int right=kInvalidNodeId) |
| | set the leaf value of the node
|
| |
|
XGBOOST_DEVICE void | MarkDelete () |
| | mark that this node is deleted
|
| |
|
XGBOOST_DEVICE void | Reuse () |
| | Reuse this deleted node.
|
| |
|
XGBOOST_DEVICE void | SetParent (int pidx, bool is_left_child=true) |
| |
|
bool | operator== (const Node &b) const |
| |
|
Node | ByteSwap () const |
| |
◆ LeafValue()
- Returns
- get leaf value of leaf node
◆ SetLeaf()
set the leaf value of the node
- Parameters
-
| value | leaf value |
| right | right index, could be used to store additional information |
◆ SetLeftChild()
set the left child
- Parameters
-
| nid | node id to right child |
◆ SetRightChild()
set the right child
- Parameters
-
| nid | node id to right child |
◆ SetSplit()
| XGBOOST_DEVICE void xgboost::RegTree::Node::SetSplit |
( |
unsigned |
split_index, |
|
|
SplitCondT |
split_cond, |
|
|
bool |
default_left = false |
|
) |
| |
|
inline |
set split condition of current node
- Parameters
-
| split_index | feature index to split |
| split_cond | split condition |
| default_left | the default direction when feature is unknown |
◆ SplitCond()
- Returns
- get split condition of the node
The documentation for this class was generated from the following file: