8#ifndef XGBOOST_TREE_UPDATER_H_
9#define XGBOOST_TREE_UPDATER_H_
17#include <xgboost/span.h>
76 const std::vector<RegTree*>& out_trees) = 0;
93 [[nodiscard]]
virtual char const* Name()
const = 0;
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)
Common base class for function registry.
Definition registry.h:151
Internal data structured used by XGBoost during training.
Definition data.h:509
Definition host_device_vector.h:87
Data structure representing JSON format.
Definition json.h:357
interface of tree update module, that performs update of a tree.
Definition tree_updater.h:36
~TreeUpdater() override=default
virtual destructor
virtual void Update(tree::TrainParam const *param, HostDeviceVector< 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
static TreeUpdater * Create(const std::string &name, Context const *ctx, ObjInfo const *task)
Create a tree updater given name.
Definition tree_updater.cc:17
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
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
virtual void Configure(const Args &args)=0
Initialize the updater with given arguments.
span class implementation, based on ISO++20 span<T>. The interface should be the same.
Definition span.h:424
A tensor view with static type and dimension.
Definition linalg.h:293
A device-and-host vector abstraction layer.
Copyright 2015-2023 by XGBoost Contributors.
Copyright 2015-2023 by XGBoost Contributors.
Copyright 2021-2023 by XGBoost Contributors.
Defines the abstract interface for different components in XGBoost.
namespace of xgboost
Definition base.h:90
Registry utility that helps to build registry singletons.
Runtime context for XGBoost.
Definition context.h:84
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
training parameters for regression tree
Definition param.h:28
Copyright 2014-2023 by Contributors.