Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions
xgboost::linear::FeatureSelector Class Referenceabstract

Abstract class for stateful feature selection or ordering in coordinate descent algorithms. More...

#include <coordinate_common.h>

Inheritance diagram for xgboost::linear::FeatureSelector:
xgboost::linear::CyclicFeatureSelector xgboost::linear::GreedyFeatureSelector xgboost::linear::RandomFeatureSelector xgboost::linear::ShuffleFeatureSelector xgboost::linear::ThriftyFeatureSelector

Public Member Functions

virtual ~FeatureSelector ()=default
 virtual destructor
 
virtual void Setup (Context const *, const gbm::GBLinearModel &, const std::vector< GradientPair > &, DMatrix *, float, float, int)
 Setting up the selector state prior to looping through features.
 
virtual int NextFeature (Context const *ctx, int iteration, const gbm::GBLinearModel &model, int group_idx, const std::vector< GradientPair > &gpair, DMatrix *p_fmat, float alpha, float lambda)=0
 Select next coordinate to update.
 

Static Public Member Functions

static FeatureSelectorCreate (int choice)
 factory method
 

Detailed Description

Abstract class for stateful feature selection or ordering in coordinate descent algorithms.

Member Function Documentation

◆ NextFeature()

virtual int xgboost::linear::FeatureSelector::NextFeature ( Context const *  ctx,
int  iteration,
const gbm::GBLinearModel model,
int  group_idx,
const std::vector< GradientPair > &  gpair,
DMatrix p_fmat,
float  alpha,
float  lambda 
)
pure virtual

Select next coordinate to update.

Parameters
ctxBooster context
iterationThe iteration in a loop through features
modelThe model.
group_idxZero-based index of the group.
gpairThe gpair.
p_fmatThe feature matrix.
alphaRegularisation alpha.
lambdaRegularisation lambda.
Returns
The index of the selected feature. -1 indicates none selected.

Implemented in xgboost::linear::CyclicFeatureSelector, xgboost::linear::ShuffleFeatureSelector, xgboost::linear::ThriftyFeatureSelector, xgboost::linear::RandomFeatureSelector, and xgboost::linear::GreedyFeatureSelector.

◆ Setup()

virtual void xgboost::linear::FeatureSelector::Setup ( Context const *  ,
const gbm::GBLinearModel ,
const std::vector< GradientPair > &  ,
DMatrix ,
float  ,
float  ,
int   
)
inlinevirtual

Setting up the selector state prior to looping through features.

Parameters
ctxThe booster context.
modelThe model.
gpairThe gpair.
p_fmatThe feature matrix.
alphaRegularisation alpha.
lambdaRegularisation lambda.
paramA parameter with algorithm-dependent use.

Reimplemented in xgboost::linear::GreedyFeatureSelector, xgboost::linear::ShuffleFeatureSelector, and xgboost::linear::ThriftyFeatureSelector.


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