xgboost
| 公共成员函数 | 所有成员列表
xgboost::RegTree::Node 类参考

树节点 更多...

#include <tree_model.h>

xgboost::RegTree::Node 协作图
Collaboration graph

公共成员函数

XGBOOST_DEVICE Node ()
 
 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
 左子节点的索引 更多...
 
XGBOOST_DEVICE int RightChild () const
 右子节点的索引 更多...
 
XGBOOST_DEVICE int DefaultChild () const
 当特征缺失时的默认子节点索引 更多...
 
XGBOOST_DEVICE bst_feature_t SplitIndex () const
 分裂条件的特征索引 更多...
 
XGBOOST_DEVICE bool DefaultLeft () const
 当特征未知时,是否走向左子节点 更多...
 
XGBOOST_DEVICE bool IsLeaf () const
 当前节点是否是叶子节点 更多...
 
XGBOOST_DEVICE float LeafValue () const
 
XGBOOST_DEVICE SplitCondT SplitCond () const
 
XGBOOST_DEVICE int Parent () const
 获取节点的父节点 更多...
 
XGBOOST_DEVICE bool IsLeftChild () const
 当前节点是否是左子节点 更多...
 
XGBOOST_DEVICE bool IsDeleted () const
 此节点是否已删除 更多...
 
XGBOOST_DEVICE bool IsRoot () const
 当前节点是否是根节点 更多...
 
XGBOOST_DEVICE void SetLeftChild (int nid)
 设置左子节点 更多...
 
XGBOOST_DEVICE void SetRightChild (int nid)
 设置右子节点 更多...
 
XGBOOST_DEVICE void SetSplit (unsigned split_index, SplitCondT split_cond, bool default_left=false)
 设置当前节点的分裂条件 更多...
 
XGBOOST_DEVICE void SetLeaf (bst_float value, int right=kInvalidNodeId)
 设置节点的叶子值 更多...
 
XGBOOST_DEVICE void MarkDelete ()
 标记此节点已删除 更多...
 
XGBOOST_DEVICE void Reuse ()
 重用此已删除的节点。 更多...
 
XGBOOST_DEVICE void SetParent (int pidx, bool is_left_child=true)
 
bool operator== (const Node &b) const
 
Node ByteSwap () const
 

详细描述

树节点

构造函数和析构函数文档

◆ Node() [1/2]

XGBOOST_DEVICE xgboost::RegTree::Node::Node ( )
inline

◆ Node() [2/2]

xgboost::RegTree::Node::Node ( int32_t  cleft,
int32_t  cright,
int32_t  parent,
uint32_t  split_ind,
float  split_cond,
bool  default_left 
)
inline

成员函数文档

◆ ByteSwap()

Node xgboost::RegTree::Node::ByteSwap ( ) const
inline

◆ DefaultChild()

XGBOOST_DEVICE int xgboost::RegTree::Node::DefaultChild ( ) const
inline

当特征缺失时的默认子节点索引

◆ DefaultLeft()

XGBOOST_DEVICE bool xgboost::RegTree::Node::DefaultLeft ( ) const
inline

当特征未知时,是否走向左子节点

◆ IsDeleted()

XGBOOST_DEVICE bool xgboost::RegTree::Node::IsDeleted ( ) const
inline

此节点是否已删除

◆ IsLeaf()

XGBOOST_DEVICE bool xgboost::RegTree::Node::IsLeaf ( ) const
inline

当前节点是否是叶子节点

◆ IsLeftChild()

XGBOOST_DEVICE bool xgboost::RegTree::Node::IsLeftChild ( ) const
inline

当前节点是否是左子节点

◆ IsRoot()

XGBOOST_DEVICE bool xgboost::RegTree::Node::IsRoot ( ) const
inline

当前节点是否是根节点

◆ LeafValue()

XGBOOST_DEVICE float xgboost::RegTree::Node::LeafValue ( ) const
inline
返回值
获取叶子节点的叶子值

◆ LeftChild()

XGBOOST_DEVICE int xgboost::RegTree::Node::LeftChild ( ) const
inline

左子节点的索引

◆ MarkDelete()

XGBOOST_DEVICE void xgboost::RegTree::Node::MarkDelete ( )
inline

标记此节点已删除

◆ operator==()

bool xgboost::RegTree::Node::operator== ( const Node b) const
inline

◆ Parent()

XGBOOST_DEVICE int xgboost::RegTree::Node::Parent ( ) const
inline

获取节点的父节点

◆ Reuse()

XGBOOST_DEVICE void xgboost::RegTree::Node::Reuse ( )
inline

重用此已删除的节点。

◆ RightChild()

XGBOOST_DEVICE int xgboost::RegTree::Node::RightChild ( ) const
inline

右子节点的索引

◆ SetLeaf()

XGBOOST_DEVICE void xgboost::RegTree::Node::SetLeaf ( bst_float  value,
int  right = kInvalidNodeId 
)
inline

设置节点的叶子值

参数
value叶子值
right右索引,可用于存储额外信息

◆ SetLeftChild()

XGBOOST_DEVICE void xgboost::RegTree::Node::SetLeftChild ( int  nid)
inline

设置左子节点

参数
nid节点ID

◆ SetParent()

XGBOOST_DEVICE void xgboost::RegTree::Node::SetParent ( int  pidx,
bool  is_left_child = true 
)
inline

◆ SetRightChild()

XGBOOST_DEVICE void xgboost::RegTree::Node::SetRightChild ( int  nid)
inline

设置右子节点

参数
nid节点ID

◆ SetSplit()

XGBOOST_DEVICE void xgboost::RegTree::Node::SetSplit ( unsigned  split_index,
SplitCondT  split_cond,
bool  default_left = false 
)
inline

设置当前节点的分裂条件

参数
split_index分裂的特征索引
split_cond分裂条件
default_left特征未知时的默认方向

◆ SplitCond()

XGBOOST_DEVICE SplitCondT xgboost::RegTree::Node::SplitCond ( ) const
inline
返回值
获取节点的分裂条件

◆ SplitIndex()

XGBOOST_DEVICE bst_feature_t xgboost::RegTree::Node::SplitIndex ( ) const
inline

分裂条件的特征索引


此类的文档是从以下文件生成的