Handles selection of columns due to colsample_bytree, colsample_bylevel and colsample_bynode parameters. Should be initialised before tree construction and to reset when tree construction is completed.
More...
#include <random.h>
Handles selection of columns due to colsample_bytree, colsample_bylevel and colsample_bynode parameters. Should be initialised before tree construction and to reset when tree construction is completed.
◆ ColumnSampler() [1/2]
xgboost::common::ColumnSampler::ColumnSampler |
( |
uint32_t |
seed | ) |
|
|
inlineexplicit |
Column sampler constructor.
- Note
- This constructor manually sets the rng seed
◆ ColumnSampler() [2/2]
xgboost::common::ColumnSampler::ColumnSampler |
( |
| ) |
|
|
inline |
Column sampler constructor.
- Note
- This constructor synchronizes the RNG seed across processes.
◆ ColSample()
◆ GetFeatureSet()
Samples a feature set.
- Parameters
-
depth | The tree depth of the node at which to sample. |
- Returns
- The sampled feature set.
- Note
- If colsample_bynode_ < 1.0, this method creates a new feature set each time it is called. Therefore, it should be called only once per node.
-
With distributed xgboost, this function must be called exactly once for the construction of each tree node, and must be called the same number of times in each process and with the same parameters to return the same feature set across processes.
◆ Init()
void xgboost::common::ColumnSampler::Init |
( |
int64_t |
num_col, |
|
|
std::vector< float > |
feature_weights, |
|
|
float |
colsample_bynode, |
|
|
float |
colsample_bylevel, |
|
|
float |
colsample_bytree |
|
) |
| |
|
inline |
Initialise this object before use.
- Parameters
-
num_col | |
colsample_bynode | |
colsample_bylevel | |
colsample_bytree | |
skip_index_0 | (Optional) True to skip index 0. |
◆ Reset()
void xgboost::common::ColumnSampler::Reset |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file:
- /home/runner/work/xgboost/xgboost/src/common/random.h