Gradient Boosting
Chain weak learners so each one corrects only the mistakes of the one before it — an additive process that converts many shallow trees into a powerful ensemble.
A single shallow tree can only approximate the data coarsely. What is left over — the gap between prediction and truth — is the residual. Gradient boosting treats that residual as the next problem to solve.
Train on the Mistakes
The second tree never sees the original labels. It fits the residuals from the first tree, shifting the ensemble prediction closer to the truth. Then a third tree fits the residuals of the combined prediction, and so on.
An Additive Chain of Corrections
The final prediction is the plain sum of every tree's output. Each tree is deliberately kept shallow — a weak learner — so no single stage can overfit. The strength comes from the chain, not from any individual component.
Learning Rate Keeps Steps Small
Each stage's correction is multiplied by a learning rate before it is added. A rate near 1 risks overshooting the target; a rate near 0.1 takes many small steps, which regularises the ensemble and usually lands closer to the true minimum.
Where It Breaks
There is no natural stopping point in the residual-fitting loop. Training error always falls; test error eventually turns around. Adding stages past the optimal count is gradient boosting's failure mode — it will memorise every quirk of the training set if allowed to run long enough. Early stopping and cross-validation are not optional.
The Quick Version
- One shallow tree makes a coarse prediction; the gap is the residual.
- The next tree is trained to predict the residual, not the original label.
- Every stage adds its scaled correction to a running sum.
- A learning rate below 1 prevents over-correction at each step.
- Too many stages always overfits — use early stopping, not faith.