xgboost
Public Member Functions | Static Public Member Functions | List of all members
xgboost::TreeUpdater Class Referenceabstract

interface of tree update module, that performs update of a tree. More...

#include <tree_updater.h>

Collaboration diagram for xgboost::TreeUpdater:
Collaboration graph

Public Member Functions

virtual ~TreeUpdater ()=default
 virtual destructor More...
 
virtual void Init (const std::vector< std::pair< std::string, std::string > > &args)=0
 Initialize the updater with given arguments. More...
 
virtual void Update (HostDeviceVector< GradientPair > *gpair, DMatrix *data, const std::vector< RegTree *> &trees)=0
 perform update to the tree models More...
 
virtual bool UpdatePredictionCache (const DMatrix *data, HostDeviceVector< bst_float > *out_preds)
 determines whether updater has enough knowledge about a given dataset to quickly update prediction cache its training data and performs the update if possible. More...
 

Static Public Member Functions

static TreeUpdaterCreate (const std::string &name)
 Create a tree updater given name. More...
 

Detailed Description

interface of tree update module, that performs update of a tree.

Constructor & Destructor Documentation

◆ ~TreeUpdater()

virtual xgboost::TreeUpdater::~TreeUpdater ( )
virtualdefault

virtual destructor

Member Function Documentation

◆ Create()

static TreeUpdater* xgboost::TreeUpdater::Create ( const std::string &  name)
static

Create a tree updater given name.

Parameters
nameName of the tree updater.

◆ Init()

virtual void xgboost::TreeUpdater::Init ( const std::vector< std::pair< std::string, std::string > > &  args)
pure virtual

Initialize the updater with given arguments.

Parameters
argsarguments to the objective function.

◆ Update()

virtual void xgboost::TreeUpdater::Update ( HostDeviceVector< GradientPair > *  gpair,
DMatrix data,
const std::vector< RegTree *> &  trees 
)
pure virtual

perform update to the tree models

Parameters
gpairthe gradient pair statistics of the data
dataThe data matrix passed to the updater.
treesreferences the trees to be updated, updater will change the content of trees note: all the trees in the vector are updated, with the same statistics, but maybe different random seeds, usually one tree is passed in at a time, there can be multiple trees when we train random forest style model

◆ UpdatePredictionCache()

virtual bool xgboost::TreeUpdater::UpdatePredictionCache ( const DMatrix data,
HostDeviceVector< bst_float > *  out_preds 
)
inlinevirtual

determines whether updater has enough knowledge about a given dataset to quickly update prediction cache its training data and performs the update if possible.

Parameters
datadata matrix
out_predsprediction cache to be updated
Returns
boolean indicating whether updater has capability to update the prediction cache. If true, the prediction cache will have been updated by the time this function returns.

The documentation for this class was generated from the following file: