Gradient boosting is a machine learning technique that builds a strong predictive model by adding many small models, usually decision trees, one at a time, with each new tree correcting the errors of the ones before it. The scikit-learn user guide describes gradient tree boosting as a generalisation of boosting to arbitrary differentiable loss functions, and calls it an excellent model for regression and classification, in particular for tabular data.
This page is for data scientists, ML engineers and technical leaders who want to understand how gradient boosting works, how it compares with other models, how to keep it from overfitting, and where it fits in AI agent systems.
Boosting combines weak learners into a strong one. In gradient boosting, each new tree is fitted to the negative gradient of the loss for the current predictions. The scikit-learn user guide calls this a kind of gradient descent in a functional space.
The XGBoost documentation gives the same idea in plain terms: fix what has been learned, and add one new tree at a time. The final prediction is the sum of the scores from all the trees.
The XGBoost documentation adds that the training objective has two parts: a loss that measures fit, and a regularisation term that controls model complexity and helps avoid overfitting.
The scikit-learn user guide names several controls. The learning rate, a value above 0 and up to 1, controls overfitting through shrinkage. Smaller values need more trees, and the guide cites a small constant such as 0.1 or less, with enough trees that early stopping applies.
Subsampling trains each tree on a fraction of the data, drawn without replacement, which is called stochastic gradient boosting. The guide gives 0.5 as a typical value. Limiting the number of features per split can also cut runtime. Early stopping uses a validation set to pick the number of trees.
| Approach | How it builds the model | Best known for |
|---|---|---|
| Gradient boosting | Trees added in sequence, each correcting the current ensemble | Strong results on tabular data |
| Random forest | Many trees trained independently, then combined | Combining independent trees by averaging or voting |
| Single decision tree | One tree | A simple, readable building block |
| Neural network | Layers of weights trained together | Deep learning on unstructured data |
The scikit-learn user guide also notes limits. Multiclass problems are costly, because one tree per class is built at each step. For large datasets it recommends the histogram-based estimators, which it says can be orders of magnitude faster beyond tens of thousands of samples.
It is a common choice for tabular problems such as credit and fraud scoring, churn prediction, demand forecasting and ranking, where the inputs are columns in a table. Libraries such as XGBoost, LightGBM and CatBoost implement it, and scikit-learn includes its own estimators.
AI agents often call a trained model, such as a boosted-tree score for risk or churn, as one step in a larger workflow. The agent then acts on that score, so the model version, its inputs and the rule that applied should be traceable. ElixirClaw, XenonStack's AI agents computing platform, is where such agents are built and run.
To map one decision your agents make, and the data and policy it depends on, book a Context Workshop. See what happens in the workshop.
Gradient boosting builds a model in steps. Each new small tree is trained to fix the errors that the trees before it still make, and the trees are added together to give the final prediction.
A random forest trains many trees independently and combines them. Gradient boosting trains trees in sequence, with each tree correcting the current ensemble.
Common implementations are XGBoost, LightGBM and CatBoost, along with the gradient boosting estimators in scikit-learn. Teams often benchmark two or three on their own data.
Use a small learning rate, subsample rows and features, regularise the trees, and apply early stopping on a validation set.
It works best on structured, tabular data, where it is a strong default for regression and classification.