Skip to content
StackDecode
AI & ML Atlas
Machine LearningalgorithmInteractive simulation

Gradient Boosting

Adds small trees one at a time, each fixing the previous errors.

The idea

Start with a simple prediction, such as the mean. Compute the residuals (what is still wrong) and fit a small tree to them; add a fraction of that tree (the learning rate) to the model. Repeating this walks the predictions downhill on the loss, which is gradient descent in function space.

Fₘ(x) = Fₘ₋₁(x) + η·hₘ(x)

Watch it run

This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.

  • data
  • ensemble prediction
  • residuals

Start with the simplest model: predict the average everywhere.

round:
0
error:
0.0545
1/25

Each round fits a tiny one-split tree to what the ensemble still gets wrong.

Step by step

  1. 1Begin with a constant prediction.
  2. 2Compute the residuals (the negative gradient of the loss).
  3. 3Fit a shallow tree to the residuals.
  4. 4Add the tree to the model, scaled by the learning rate.
  5. 5Repeat for many rounds.

Where it is used

State-of-the-art on many tabular problems.

Watch out for

More rounds overfit; a small learning rate with early stopping is the usual remedy.

Related