树更新模块的接口,用于执行树的更新。更多...
#include <tree_updater.h>
◆ TreeUpdater()
| xgboost::TreeUpdater::TreeUpdater |
( |
const Context * |
ctx | ) |
|
|
内联显式 |
◆ ~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 const char* xgboost::TreeUpdater::Name |
( |
| ) |
const |
|
纯虚函数 |
◆ Update()
对树模型执行更新
- 参数
-
| param | 用于构建树的超参数。 |
| gpair | 数据的梯度对统计。 |
| 数据 | 传递给更新器的数据矩阵。 |
| out_position | 每行的叶子索引。如果该行在采样过程中被移除,则索引为负。因此第 3 个节点是 ~3。 |
| out_trees | 引用要更新的树,更新器将更改树的内容 注意:向量中的所有树都使用相同的统计信息进行更新,但可能使用不同的随机种子,通常一次只传递一棵树,当我们训练随机森林样式模型时可以有多棵树 |
◆ UpdatePredictionCache()
确定更新器是否对给定数据集有足够的了解,以便快速更新其训练数据的预测缓存,并在可能的情况下执行更新。
- 参数
-
- 返回
- 布尔值,指示更新器是否具有更新预测缓存的能力。如果为 true,则在函数返回时,预测缓存将已更新。
◆ ctx_
| Context const* xgboost::TreeUpdater::ctx_ = nullptr |
|
protected |
此类的文档由以下文件生成
- /home/docs/checkouts/readthedocs.org/user_builds/xgboost/checkouts/stable/include/xgboost/tree_updater.h