8 #ifndef XGBOOST_TREE_UPDATER_H_
9 #define XGBOOST_TREE_UPDATER_H_
11 #include <dmlc/registry.h>
76 const std::vector<RegTree*>& out_trees) = 0;
93 [[nodiscard]]
virtual char const*
Name()
const = 0;
108 :
public dmlc::FunctionRegEntryBase<
109 TreeUpdaterReg, std::function<TreeUpdater*(Context const* ctx, ObjInfo const* task)>> {};
123 #define XGBOOST_REGISTER_TREE_UPDATER(UniqueId, Name) \
124 static DMLC_ATTRIBUTE_UNUSED ::xgboost::TreeUpdaterReg& \
125 __make_ ## TreeUpdaterReg ## _ ## UniqueId ## __ = \
126 ::dmlc::Registry< ::xgboost::TreeUpdaterReg>::Get()->__REGISTER__(Name)
Defines configuration macros and basic types for xgboost.
Internal data structured used by XGBoost during training.
Definition: data.h:505
Definition: host_device_vector.h:87
Data structure representing JSON format.
Definition: json.h:368
interface of tree update module, that performs update of a tree.
Definition: tree_updater.h:36
Context const * ctx_
Definition: tree_updater.h:38
~TreeUpdater() override=default
virtual destructor
virtual bool UpdatePredictionCache(const DMatrix *, linalg::MatrixView< float >)
determines whether updater has enough knowledge about a given dataset to quickly update prediction ca...
Definition: tree_updater.h:88
static TreeUpdater * Create(const std::string &name, Context const *ctx, ObjInfo const *task)
Create a tree updater given name.
virtual bool CanModifyTree() const
Whether this updater can be used for updating existing trees.
Definition: tree_updater.h:55
virtual bool HasNodePosition() const
Wether the out_position in Update is valid. This determines whether adaptive tree can be used.
Definition: tree_updater.h:60
TreeUpdater(const Context *ctx)
Definition: tree_updater.h:41
virtual void Update(tree::TrainParam const *param, linalg::Matrix< GradientPair > *gpair, DMatrix *data, common::Span< HostDeviceVector< bst_node_t >> out_position, const std::vector< RegTree * > &out_trees)=0
perform update to the tree models
virtual void Configure(const Args &args)=0
Initialize the updater with given arguments.
virtual char const * Name() const =0
span class implementation, based on ISO++20 span<T>. The interface should be the same.
Definition: span.h:422
A tensor view with static type and dimension. It implements indexing and slicing.
Definition: linalg.h:294
A tensor storage. To use it for other functionality like slicing one needs to obtain a view first....
Definition: linalg.h:762
The input data structure of xgboost.
A device-and-host vector abstraction layer.
Linear algebra related utilities.
Defines the abstract interface for different components in XGBoost.
Core data structure for multi-target trees.
Definition: base.h:87
std::vector< std::pair< std::string, std::string > > Args
Definition: base.h:310
Runtime context for XGBoost. Contains information like threads and device.
Definition: context.h:133
A struct returned by objective, which determines task at hand. The struct is not used by any algorith...
Definition: task.h:24
Registry entry for tree updater.
Definition: tree_updater.h:109