Random Forests(TM) in XGBoost
XGBoost is normally used to train gradient-boosted decision trees and other gradient boosted models. Random Forests use the same model representation and inference, as gradient-boosted decision trees, but a different training algorithm. One can use XGBoost to train a standalone random forest or use random forest as a base model for gradient boosting. Here we focus on training standalone random forest.
We have native APIs for training random forests since the early days, and a new Scikit-Learn wrapper after 0.82 (not included in 0.82). Please note that the new Scikit-Learn wrapper is still experimental, which means we might change the interface whenever needed.
Standalone Random Forest With XGBoost API
The following parameters must be set to enable random forest training.
boostershould be set togbtree, as we are training forests. Note that as this is the default, this parameter needn’t be set explicitly.subsamplemust be set to a value less than 1 to enable random selection of training cases (rows).One of
colsample_by*parameters must be set to a value less than 1 to enable random selection of columns. Normally,would be set to a value less than 1 to randomly sample columns at each tree split.