- Introduced by
- Friedman, J. H.
- Year
- 2001
- Type
- Ensemble (sequential boosting of decision trees)
What does it do?
Gradient Boosting is an ensemble learning method, formalised by Jerome H. Friedman in 2001, that combines a sequence of weak learners, typically shallow decision trees.
Each new tree is fitted to the negative gradient of the loss with respect to the current predictions, so the ensemble is corrected step by step. Widely used libraries such as XGBoost, LightGBM and CatBoost are built on this principle, but they add implementation-specific extensions, so their results can differ from Friedman's original procedure.
The intuition behind the method
Rather than fitting one strong model at once, Gradient Boosting adds small trees one after another, and each new tree is trained to predict where the current ensemble is wrong. The target for each tree is the negative gradient of the loss, so every step moves the predictions in the direction that most reduces the loss. Summing many small corrections produces a predictor that is more accurate than any single tree.
History
Friedman's 2001 Annals of Statistics paper, Greedy Function Approximation: A Gradient Boosting Machine, treated function estimation as numerical optimisation in function space and connected stagewise additive expansions with steepest-descent minimisation. The paper also discussed the connections between this approach and earlier boosting methods, including those of Freund and Schapire and of Friedman, Hastie and Tibshirani. Gradient-boosted regression trees later became the basis of widely used libraries such as XGBoost, LightGBM and CatBoost.
When to use it
Choose Gradient Boosting for accurate classification or prediction on tabular data where predictive performance is the main goal and there is enough data to tune the model, including features of mixed types. Feature scaling is generally not needed, because tree splits depend on the ordering of feature values rather than their magnitude. Avoid it when the sample is small, since the sequential trees can fit noise, and a simpler model such as a single decision tree or Random Forest is then safer. It is also a poor fit when no held-out data is available for early stopping. Some implementations require categorical features to be encoded before training, while others handle categorical inputs directly, so the documentation of the implementation in use should be checked.
Limitations and considerations
- Trees are trained one after another, so they cannot be grown independently of one another as in Random Forest.
- Because each tree corrects the errors left by earlier trees, the procedure is greedy and will fit noise if run for too many rounds without regularisation.
- The number of trees, the learning rate and the tree depth interact and must be tuned together, which takes time.
- With small samples the sequential trees tend to memorise noise, and the held-out data needed for early stopping and tuning may be too limited to set these values reliably.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Each tree is fitted to the negative gradient of the loss, so the same procedure applies to any differentiable loss; the source abstract cites least-squares, least absolute deviation, Huber-M and multiclass logistic losses.
- Feature scaling is generally unnecessary, because tree splits depend only on the ordering of feature values.
- The learning rate shrinks each tree's contribution, giving direct control over how cautiously the ensemble moves toward the data.
- Regression trees as base learners allow the fitted model to be interpreted, and the source abstract describes tools for this in the TreeBoost variant.
Applications
- Classification and prediction on tabular data where predictive accuracy is the main objective.
- Regression with robust loss functions, such as least absolute deviation or Huber loss, on data that is not perfectly clean.
- Serving as the basis of production libraries such as XGBoost, LightGBM and CatBoost, which extend the original procedure in implementation-specific ways.
How it works
How it works
Gradient Boosting trains weak learners, usually shallow decision trees, one after another rather than independently. The ensemble starts from a simple initial estimate, and each later tree is added to correct what the current model still gets wrong. Because every tree depends on the trees before it, the trees cannot be grown independently of one another.
At each round the method computes the negative gradient of the loss with respect to the current predictions. For squared-error loss this is the ordinary residual. The next regression tree h_m is fitted to these values and added with a small learning-rate weight nu: F_m(x) = F_{m-1}(x) + nu * h_m(x). Keeping nu small shrinks each correction, so the model improves gradually rather than overcorrecting.
Formula
F_{m}(x) = F_{m-1}(x) + \nu \, h_m(x)The final prediction is the initial estimate plus the sum of all the scaled tree corrections. Because the trees are added greedily to chase the remaining error, the number of trees, the learning rate and the tree depth must be chosen together. Early stopping on held-out data is used to limit overfitting.
Common pitfalls
- Letting boosting run for too many rounds without early stopping, so that later trees fit noise.
- Setting the learning rate too high, so that each tree overcorrects instead of making a small adjustment.
- Applying it to a small sample, where the sequential trees memorise noise.
- Keeping default hyperparameters instead of tuning the number of trees, the learning rate and the maximum depth.
- Assuming feature scaling is required, as it is for distance-based models; for tree-based boosting it is generally unnecessary.
Frequently asked questions
How is Gradient Boosting different from Random Forest?
Random Forest builds many independent trees in parallel and averages them, whereas Gradient Boosting builds trees sequentially, each one fitted to correct the errors of the ones before it. Boosting often reaches higher accuracy but is more sensitive to overfitting and needs careful tuning.
Why is early stopping recommended?
Because each new tree chases the remaining error, an over-long boosting run starts fitting noise. Early stopping halts training once validation performance stops improving, which is the main safeguard against overfitting.
Do I need to scale my features?
Feature scaling is generally not required for tree-based gradient boosting, since splits depend on the order of values rather than their magnitude. The main settings to choose are the number of trees, the learning rate and the tree depth.
What sample size do I need?
The required sample size depends on how noisy the data are, and no universal minimum applies. With small samples the sequential trees tend to fit noise, so a single decision tree or Random Forest is often the safer choice.
Related methods
Sources
Friedman, J. H. (2001). Greedy Function Approximation: A Gradient Boosting Machine. Annals of Statistics, 29(5), 1189–1232.
Open DOI referenceThe Elements of Statistical Learning, Sections 10.12-10.13 (Regularization; Interpretation), pp. 364-369
Applied Predictive Modeling, Section 14.5 (Boosting), p. 391