advancedadvanced-ml

Gradient Boosting

Instead of reweighting mistakes, each new model directly predicts the error of the last one.

Key Points

What it is

Gradient Boosting builds models sequentially, where each new model is trained to predict the residual errors (what's left over) of the combined models so far, using gradient descent to minimize a loss function. Adding these error-correcting models together produces a strong final predictor.

Why it exists

AdaBoost reweights misclassified examples but doesn't explicitly say 'this is exactly how wrong you were and in what direction.' Gradient Boosting exists to generalize boosting into an optimization problem: at every step, fit a new model to the gradient of the loss, moving the overall prediction closer to the truth the same way gradient descent moves toward a minimum.

Intuition

Imagine estimating someone's house price. Your first guess is off by $40,000. Instead of starting over, your second model's only job is to predict that $40,000 error. Your third model's job is to predict whatever error is still left after adding model two's correction. Keep stacking correction on top of correction, and your total estimate gets closer and closer to the real price.

Example

True house price: $300k. Model 1 predicts $260k (residual = $40k). Model 2 is trained to predict that $40k residual and outputs $30k, bringing the total to $290k (residual = $10k). Model 3 predicts $8k of that, bringing the total to $298k.

Each successive tree chips away at whatever error remains, so the combined prediction converges toward the true value over many rounds.

Formulas

Additive Model Update

Fm(x)=Fm−1(x)+η⋅hm(x)F_{m}(x) = F_{m-1}(x) + \eta \cdot h_{m}(x)
  • F_{m}(x) — Combined prediction after m rounds of boosting
  • h_{m}(x) — The new tree trained to predict the residual/gradient at round m
  • \eta — Learning rate — how much to trust each new tree's correction

When to use

When not to use

Common mistakes

In practice

The dominant algorithm family for winning tabular-data machine learning competitions and a common production choice for credit scoring, ranking, click-through-rate prediction, and demand forecasting, usually via XGBoost or LightGBM rather than from scratch.

Was this concept helpful?

Spot an error or gap? Suggest an edit →

Related concepts

ensemble-methodsadaboostrandom-forestlinear-regression
Chirp at me!