Start with a very simple guess. Then add one small tree at a time, each one trained only to fix what the model so far still gets wrong. Press play and watch a weak learner become a strong one.
The model starts as one number: the average of y. After that, every round computes the residuals (how far each point is from the current prediction) and fits a small tree to those. The tree’s output, shrunk by η, is added to the model. Slide through the rounds to see the pattern.
Residual = y − Fk−1(x). For squared error, the residual is exactly the negative gradient of the loss, which is why this is called gradient boosting. Early rounds have big residuals; later rounds only chase what is left.
Training error keeps falling with every tree, because the model can always memorise a bit more. Validation error falls too, then turns back up once the trees start fitting noise. The best moment to stop is the lowest point of the pink curve.
The learning rate η scales each tree’s contribution. Big η learns fast but can overshoot and overfit quickly. Small η needs more trees but usually ends up at a better validation score. Solid lines are training error, dashed lines are validation error, all on your current data.
This is the classic boosting trade-off: lower the learning rate and raise the number of rounds together. It is the same idea behind libraries like XGBoost and LightGBM.
Noisy data, deep trees, big steps, 60 rounds. Watch train error crash while validation error climbs.
Set η to 0.02 with only 15 rounds. The model barely moves: it is under-trained, not wrong.
Add a point that fights the trend. Later trees chase its huge residual and bend the curve.