xgboost

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

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

`#include <tree_updater.h>`

Inheritance diagram for xgboost::TreeUpdater:
Collaboration diagram for xgboost::TreeUpdater:

## Public Member Functions
| ~TreeUpdater () override=default
| virtual destructor More...
virtual void | Configure (const Args &args)=0
| Initialize the updater with given arguments. More...
virtual bool | CanModifyTree () const
| Whether this updater can be used for updating existing trees. 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...
virtual char const * | Name () const =0
Public Member Functions inherited from xgboost::Configurable
virtual | ~Configurable ()=default
virtual void | LoadConfig (Json const &in)=0
| Load configuration from JSON object. More...
virtual void | SaveConfig (Json *out) const =0
| Save configuration to JSON object. More...

## Static Public Member Functions
static TreeUpdater * | Create (const std::string &name, GenericParameter const *tparam)
| Create a tree updater given name. More...

## Protected Attributes
GenericParameter const * | tparam_

## Detailed Description

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

## Constructor & Destructor Documentation

## ◆ ~TreeUpdater()

xgboost::TreeUpdater::~TreeUpdater | ( |  | ) |
| override default

virtual destructor

## Member Function Documentation

## ◆ CanModifyTree()

virtual bool xgboost::TreeUpdater::CanModifyTree | ( |  | ) | const
| inline virtual

Whether this updater can be used for updating existing trees.

Some updaters are used for building new trees (like `hist`), while some others are used for modifying existing trees (like `prune`). Return true if it can modify existing trees.

## ◆ Configure()

virtual void xgboost::TreeUpdater::Configure | ( | const Args & | args | ) |
| pure virtual

Initialize the updater with given arguments.

Parameters

  args | arguments to the objective function.

## ◆ Create()

static TreeUpdater* xgboost::TreeUpdater::Create | ( | const std::string & | name,
|  | GenericParameter const * | tparam
| ) |  |
| static

Create a tree updater given name.

Parameters

  name | Name of the tree updater.
  tparam | A global runtime parameter

## ◆ Name()

virtual char const* xgboost::TreeUpdater::Name | ( |  | ) | const
| pure virtual

## ◆ 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

  gpair | the gradient pair statistics of the data
  data | The data matrix passed to the updater.
  trees | references 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
| ) |  |
| inline virtual

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

  data | data matrix
  out_preds | prediction 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.

## Member Data Documentation

## ◆ tparam_

GenericParameter const* xgboost::TreeUpdater::tparam_
| protected

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

- /workspace/include/xgboost/tree_updater.h