Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
xgboost::linear::ShuffleFeatureSelector Class Reference

Similar to Cyclic but with random feature shuffling prior to each update. More...

#include <coordinate_common.h>

Inheritance diagram for xgboost::linear::ShuffleFeatureSelector:
xgboost::linear::FeatureSelector

Public Member Functions

void Setup (Context const *, const gbm::GBLinearModel &model, const std::vector< GradientPair > &, DMatrix *, float, float, int) override
 Setting up the selector state prior to looping through features.
 
int NextFeature (Context const *, int iteration, const gbm::GBLinearModel &model, int, const std::vector< GradientPair > &, DMatrix *, float, float) override
 Select next coordinate to update.
 
 FeatureSelector ()=default
 
- Public Member Functions inherited from xgboost::linear::FeatureSelector
virtual ~FeatureSelector ()=default
 virtual destructor
 

Protected Attributes

std::vector< bst_uintfeat_index_
 

Additional Inherited Members

- Static Public Member Functions inherited from xgboost::linear::FeatureSelector
static FeatureSelectorCreate (int choice)
 factory method
 

Detailed Description

Similar to Cyclic but with random feature shuffling prior to each update.

Note
Its randomness is controllable by setting a random seed.

Member Function Documentation

◆ NextFeature()

int xgboost::linear::ShuffleFeatureSelector::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 
)
inlineoverridevirtual

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.

Implements xgboost::linear::FeatureSelector.

◆ Setup()

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

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 from xgboost::linear::FeatureSelector.


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