Skip to main content

GradientBoostingRegressor

Stage-wise boosting of shallow regression trees against the squared-error gradient.

Algorithm

Each stage fits a depth-bounded tree to the residuals of the current ensemble and adds it with a learning_rate shrinkage. Squared-error loss is supported in v1.1.0.

Constructor

Skigen::GradientBoostingRegressor<Scalar> model(Loss = SquaredError, Scalar learning_rate = 0.1, int n_estimators = 100, ...);

Parameters

ParameterDefaultDescription
learning_rate0.1Shrinkage per stage.
n_estimators100Number of stages.
max_depth3Tree depth.
subsample1.0Row fraction per stage.
random_statenulloptSeed.

Methods

MethodDescription
fit(X, y)Boost over the stages.
predict(X)Sum of shrunk stage predictions.
score(X, y)R².

Fitted Attributes

AccessorDescription
train_score()Per-stage training MSE.

Example

Skigen::GradientBoostingRegressor<double> gb;
gb.fit(X, y);
auto preds = gb.predict(X_test);
Verified against scikit-learn

This estimator is checked by the parity suite. See the generator tests/parity/generate_ensemble_reference.py and the reference fixtures in tests/parity/data/gradient_boosting_regressor/, exercised by tests/parity/parity_ensemble.cpp.

API Reference

For full signatures see the GradientBoostingRegressor API Reference.