Gradient descent walks downhill by changing numbers. Gradient boosting walks downhill by adding trees: each one is fit to the direction of steepest descent of your loss. Choose the loss, press play, and see how that choice changes everything.
The loss L(e) scores a mistake of size e = y − F. Its negative slope, r = −∂L/∂F, is the pseudo-residual: how hard, and in which direction, the model is told to move at that point. The tree of the next round is trained to predict exactly this push. The white dots mark where your current data sits.
Squared loss pushes in proportion to the error, so one huge outlier shouts louder than everyone. Absolute loss pushes with the same force no matter the size. Huber loss is squared for small errors and capped for big ones: the best of both.
Each round: compute the push r for every point, grow a small tree that predicts r, then set each leaf’s value to whatever best reduces the real loss inside that leaf (mean for squared, median for absolute). Add the tree, scaled by η. Slide through the rounds.
Here are three models trained on your exact points with the same rounds, learning rate and depth. Only the loss differs. Add an outlier and see which curve gets dragged toward it. The numbers measure each curve’s distance from the hidden true curve the data was drawn around.
Add three wild points and use squared loss. The curve bends toward them.
Keep the outliers, switch to Huber loss. The pushes are capped and the curve calms down.
Noisy data, deeper trees, and each tree sees only half of the points. Compare with subsample 100%.