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 ?, predicting on one side and 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 . Each training point carries a weight , starting uniform.
- Initialise .
- For rounds :
- Train a weak learner to minimise the weighted error .
- Give it a vote of strength
- Reweight the points: where makes the weights sum to 1.
- Output the weighted vote .
Read the two formulas.
- The vote. A learner with error (pure guessing) gets . The more accurate it is, the larger its say: gives .
- The reweighting. Since for a correct point and for a mistake, correctly classified points have their weight multiplied by (shrunk) and misclassified ones by (grown). After the update, the current learner's weighted error is exactly 50%: the next learner is forced to find something new.
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:
Write , where is how much better than chance the learner is. Then , so
If every learner is at least better than chance, the training error falls like : exponentially fast in the number of rounds. With , 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 be the ensemble's score. AdaBoost minimises the exponential loss
one term at a time: at round it adds the learner and the coefficient that reduce this loss the most, holding the earlier terms fixed. Working this out gives exactly the weighted-error criterion for , the formula for , and the reweighting rule (the weights 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 , 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.