树更新模块的接口,用于执行树的更新。 更多...
#include <tree_updater.h>
◆ TreeUpdater()
xgboost::TreeUpdater::TreeUpdater |
( |
const Context * |
ctx | ) |
|
|
inlineexplicit |
◆ ~TreeUpdater()
xgboost::TreeUpdater::~TreeUpdater |
( |
| ) |
|
|
overridedefault |
◆ CanModifyTree()
virtual bool xgboost::TreeUpdater::CanModifyTree |
( |
| ) |
const |
|
inlinevirtual |
此更新器是否可用于更新现有树。
一些更新器用于构建新树(例如 hist
),而另一些则用于修改现有树(例如 prune
)。如果它可以修改现有树,则返回 true。
◆ Configure()
virtual void xgboost::TreeUpdater::Configure |
( |
const Args & |
args | ) |
|
|
纯虚函数 |
◆ Create()
创建指定名称的树更新器。
- 参数
-
name | 树更新器的名称。 |
ctx | 全局运行时参数 |
task | 有关目标的详细信息。 |
◆ HasNodePosition()
virtual bool xgboost::TreeUpdater::HasNodePosition |
( |
| ) |
const |
|
inlinevirtual |
Update
中的 out_position 是否有效。这决定了是否可以使用自适应树。
◆ Name()
virtual char const* xgboost::TreeUpdater::Name |
( |
| ) |
const |
|
纯虚函数 |
◆ Update()
对树模型执行更新
- 参数
-
param | 构建树的超参数。 |
gpair | 数据的梯度对统计信息 |
data | 传递给更新器的数据矩阵。 |
out_position | 每行的叶节点索引。如果该行在采样过程中被移除,则索引为负。因此,第3个节点是 ~3。 |
out_trees | 引用待更新的树,更新器将改变树的内容 注意:向量中的所有树都将被更新,使用相同的统计信息,但可能有不同的随机种子,通常一次传入一棵树,当我们训练随机森林风格的模型时可以有多棵树 |
◆ UpdatePredictionCache()
确定更新器是否对给定数据集有足够的了解,以便快速更新其训练数据的预测缓存并在可能的情况下执行更新。
- 参数
-
data | 数据矩阵 |
out_preds | 待更新的预测缓存 |
- 返回
- 布尔值,指示更新器是否具有更新预测缓存的能力。如果为 true,则在此函数返回时,预测缓存已被更新。
◆ ctx_
Context const* xgboost::TreeUpdater::ctx_ = nullptr |
|
保护 |
此类的文档生成自以下文件
- /home/docs/checkouts/readthedocs.org/user_builds/xgboost/checkouts/release_3.0.0/include/xgboost/tree_updater.h