Boosting

Boosting builds an ensemble sequentially: each weak learner is trained on reweighted data that emphasises the points its predecessors got wrong, and the final classifier is a weighted vote. AdaBoost's weights αₜ = ½ln((1 − εₜ)/εₜ) come from minimising the exponential loss, its training error falls exponentially fast, and unlike bagging it mainly reduces bias.

Machine Learning Techniques

Bagging trains many strong, unstable models independently and averages away their variance. Boosting takes the opposite route: it trains many weak models (each only a little better than guessing) one after another, and each new model concentrates on the mistakes of the ones before it. Together they become a strong classifier. The question that started it, posed by Kearns and Valiant in the late 1980s, was whether "slightly better than chance" can always be turned into "arbitrarily accurate". Schapire showed in 1990 that it can, and AdaBoost (Freund and Schapire, 1995) made the idea practical.

Weak learners

A typical weak learner is a decision stump: a tree with a single question, such as is x2≤1.7x_2 \le 1.7?, predicting +1+1 on one side and −1-1 on the other. On its own a stump is a poor classifier. The only requirement is that, on whatever weighting of the data it is given, its weighted error is below 50%.

AdaBoost

Labels are yi∈{−1,+1}y_i \in \{-1, +1\}. Each training point carries a weight Dt(i)D_t(i), starting uniform.

  1. Initialise D1(i)=1/nD_1(i) = 1/n.
  2. For rounds t=1,…,Tt = 1, \dots, T:
    • Train a weak learner hth_t to minimise the weighted error ϵt=∑iDt(i) 1[ht(xi)≠yi]\epsilon_t = \sum_i D_t(i)\,\mathbf{1}[h_t(x_i) \ne y_i].
    • Give it a vote of strength αt=12ln⁡1−ϵtϵt.\alpha_t = \tfrac12 \ln\frac{1 - \epsilon_t}{\epsilon_t} .
    • Reweight the points: Dt+1(i)=Dt(i) e−αt yiht(xi)Zt,D_{t+1}(i) = \frac{D_t(i)\, e^{-\alpha_t\, y_i h_t(x_i)}}{Z_t}, where ZtZ_t makes the weights sum to 1.
  3. Output the weighted vote H(x)=sign⁡(∑t=1Tαtht(x))H(x) = \operatorname{sign}\big(\sum_{t=1}^{T}\alpha_t h_t(x)\big).

Read the two formulas.

  • The vote. A learner with error ϵt=0.5\epsilon_t = 0.5 (pure guessing) gets αt=0\alpha_t = 0. The more accurate it is, the larger its say: ϵt=0.1\epsilon_t = 0.1 gives αt=12ln⁡9≈1.10\alpha_t = \tfrac12\ln 9 \approx 1.10.
  • The reweighting. Since yiht(xi)=+1y_ih_t(x_i) = +1 for a correct point and −1-1 for a mistake, correctly classified points have their weight multiplied by e−αte^{-\alpha_t} (shrunk) and misclassified ones by e+αte^{+\alpha_t} (grown). After the update, the current learner's weighted error is exactly 50%: the next learner is forced to find something new.
Three panels of the same two-class data. Round 1: a vertical stump splits the data, three misclassified points are drawn larger. Round 2: a horizontal stump focused on the enlarged points, with new mistakes enlarged. Final: the weighted combination forming a staircase boundary that classifies all points correctly
AdaBoost round by round. Points misclassified in one round gain weight (drawn larger), so the next stump focuses on them; the weighted vote of simple stumps forms a complex boundary.

Why it works: training error falls exponentially

A short calculation shows that the training error of the final vote is bounded by the product of the normalisers:

1n∑i1[H(xi)≠yi]  ≤  ∏t=1TZt  =  ∏t=1T2ϵt(1−ϵt).\frac{1}{n}\sum_i \mathbf{1}[H(x_i) \ne y_i] \;\le\; \prod_{t=1}^{T} Z_t \;=\; \prod_{t=1}^{T} 2\sqrt{\epsilon_t(1 - \epsilon_t)} .

Write ϵt=12−γt\epsilon_t = \tfrac12 - \gamma_t, where γt\gamma_t is how much better than chance the learner is. Then 2ϵt(1−ϵt)=1−4γt2≤e−2γt22\sqrt{\epsilon_t(1-\epsilon_t)} = \sqrt{1 - 4\gamma_t^2} \le e^{-2\gamma_t^2}, so

training error  ≤  exp⁡(−2∑t=1Tγt2).\text{training error} \;\le\; \exp\Big(-2\sum_{t=1}^{T}\gamma_t^2\Big).

If every learner is at least γ\gamma better than chance, the training error falls like e−2γ2Te^{-2\gamma^2T}: exponentially fast in the number of rounds. With γ=0.1\gamma = 0.1, for example, it is below 1% after about 230 rounds.

Where the formulas come from: the exponential loss

AdaBoost is not a collection of clever tricks; it is a greedy minimiser of one loss. Let F(x)=∑tαtht(x)F(x) = \sum_t \alpha_t h_t(x) be the ensemble's score. AdaBoost minimises the exponential loss

∑i=1ne−yiF(xi)\sum_{i=1}^{n} e^{-y_i F(x_i)}

one term at a time: at round tt it adds the learner hth_t and the coefficient αt\alpha_t that reduce this loss the most, holding the earlier terms fixed. Working this out gives exactly the weighted-error criterion for hth_t, the formula for αt\alpha_t, and the reweighting rule (the weights Dt(i)D_t(i) are just the current loss of each point, normalised). The exponential loss is a smooth, convex stand-in for the 0-1 loss that punishes confident mistakes very heavily, which also explains boosting's weakness: mislabelled points get exponentially large weights, and the later learners chase them.

Bias, variance and overfitting

Boosting mainly reduces bias: it builds a flexible model from very rigid pieces. It can overfit if run for too many rounds on noisy data, so the number of rounds is chosen by validation. Remarkably, on clean data the test error often keeps falling after the training error has reached zero. The explanation is margins: extra rounds keep increasing yiF(xi)y_iF(x_i), the confidence of the vote on the training points, which (as with SVMs) tends to improve generalisation.

Gradient boosting

Viewing boosting as greedy loss minimisation suggests a generalisation: replace the exponential loss with any differentiable loss (squared error for regression, log loss for probabilities), and at each round fit a small tree to the negative gradient of the loss at the current predictions, then add it with a small step size (the learning rate). This is gradient boosting. With careful regularisation, it is the method behind XGBoost, LightGBM and CatBoost, which win a large share of machine learning competitions on tabular data.

Try it yourself
Machine Learning Lab: AdaBoost →
Choose AdaBoost and step the rounds from 1 to 60. One stump is a single straight cut; watch the staircase boundary assemble itself and the training accuracy climb.
MediumAdaBoost

A stump has weighted error 0.2. What vote α does AdaBoost give it, and how are the weights of correct and incorrect points rescaled?

MediumAdaBoostRobustness

Why does AdaBoost struggle with mislabelled training points?

MediumEnsembles

Contrast bagging and boosting: how they build the ensemble, what they reduce, and what base learners suit them.