What is gradient boosting?
Gradient boosting is an ensemble method that builds a strong model by adding many weak ones, usually small decision trees, one at a time. Each new tree is fitted to the errors of the current ensemble, more precisely to the negative gradient of the loss, and its output is scaled down by a learning rate before being added. With squared-error loss, that gradient is simply the residual: the target minus the current prediction.
Gradient-boosted trees are among the most accurate models for tabular data and often win tabular machine learning competitions. XGBoost, LightGBM, and CatBoost are the common implementations. They power click-through and ranking models in search and advertising, as well as credit scoring, fraud detection, and demand forecasting.
Key ideas
- Gradient boosting adds trees one at a time, each fitted to the current ensemble's errors.
- Each tree fits the negative gradient of the loss, which for squared error is the residual.
- A learning rate scales every tree's contribution so that no single tree dominates.
- A smaller learning rate needs more trees but usually generalizes better.
- Boosting reduces bias with shallow trees, while bagging reduces variance with deep ones.
- Early stopping on a validation set chooses the number of trees.
Short takes on this topic
Common questions
What is the difference between gradient boosting and AdaBoost?
AdaBoost reweights the training points after each round so that the next model focuses on the examples that were misclassified. Gradient boosting instead fits each new model to the gradient of a loss function. AdaBoost turns out to be a special case of this framework with exponential loss, and gradient boosting extends the idea to any differentiable loss.
What makes XGBoost different from plain gradient boosting?
XGBoost uses second-order (Newton) steps, adds L1 and L2 penalties on leaf values, learns a default direction for missing values at each split, and uses a fast approximate split search. Chen and Guestrin described it in 2016. LightGBM speeds training further with histogram-based splits and leaf-wise tree growth.
Can gradient boosting be used for classification?
Yes. For binary classification it boosts the log-odds under log loss, and each tree fits the gradient y − p, where p is the current predicted probability. For K classes it usually grows K trees per round, one per class score, and combines the scores with softmax.
Does gradient boosting need feature scaling?
No. Its trees split on thresholds, so a monotonic rescaling of a feature leaves the splits unchanged. It is also less sensitive to outliers in the inputs than linear models are, although outliers in the target still matter under squared-error loss.
Related explainers
- Decision Trees & Splitting — Recursive partitioning, Gini impurity, and pruning
- Bagging & Random Forests — Bootstrap aggregation and decorrelated tree ensembles
- Gradient Descent — Optimizing by following the slope downhill
- Loss Functions — How networks measure their mistakes
- Ensemble Methods & Stacking — Voting, stacking, and combining diverse models
- Bias-Variance Tradeoff — Why models underfit or overfit — the fundamental decomposition
References
- Friedman (2001), "Greedy Function Approximation: A Gradient Boosting Machine", Annals of Statistics
- Friedman (2002), "Stochastic Gradient Boosting", Computational Statistics & Data Analysis
- Chen & Guestrin (2016), "XGBoost: A Scalable Tree Boosting System"
- James, Witten, Hastie & Tibshirani, "An Introduction to Statistical Learning", chapter 8: Tree-Based Methods
Last updated