AdaBoost: Learning from Mistakes
The original boosting algorithm — sample re-weighting, decision stumps, and why a sequence of barely-better-than-random learners adds up to a strong model.
Bagging trains its members independently and hopes their errors cancel. Boosting is more deliberate: train models one after another, and make each new model focus on exactly the samples the previous ones got wrong. AdaBoost (Adaptive Boosting, 1997) was the first practical algorithm to pull this off, and its central idea — re-weighting mistakes — is the cleanest way to understand everything that came after it, up to and including XGBoost.
Boosting: a sequence, not a committee
A random forest is a room full of experts voting at the same time. AdaBoost is a relay: the first model does its best, then hands the second model a note saying "I keep getting these samples wrong — you focus on them." The second model hands a similar note to the third, and so on. The final prediction is a weighted vote of the whole sequence, where models that performed well get a louder voice.
Two things had to be invented to make this work:
- Sample weights — a number per training sample saying how much the next learner should care about it. Mistakes get their weight increased.
- Learner weights (α) — how much each learner's vote counts in the final ensemble, based on how accurate it was on the weights it faced.
Re-weighting, round by round
Start with all n samples weighted equally at 1/n. Each round then does:
- Train a weak learner on the current weights.
- Compute its weighted error ε (the total weight of the samples it got wrong).
- Give it a vote weight α = ½ · ln((1 − ε) / ε) — near-perfect learners get big α, coin-flip learners get α ≈ 0.
- Multiply misclassified samples' weights up and correct ones down, then renormalize so the weights sum to 1.
Let's watch the numbers move for two rounds on ten samples:
Follow sample 3 through the printout: wrong in round 1, its weight jumps from 0.10 to 0.17; wrong again in round 2, it climbs to the heaviest sample in the set. By round 3 any learner that wants a low weighted error basically must classify sample 3 correctly. That's the "adaptive" in Adaptive Boosting — the training distribution itself shifts toward the hard cases.
Weak learners and decision stumps
Boosting's base models are deliberately feeble. The classic choice is a decision stump: a depth-1 tree that asks a single question. On its own a stump barely beats a coin flip — but that's all boosting needs. Each round only has to contribute a small correction, and the weighted sum of hundreds of tiny corrections can trace an intricate boundary.
Weak learners aren't just sufficient — they're safer. A deep tree can fit the re-weighted samples (including noisy ones) almost perfectly in a round or two, which makes the ensemble jump straight to overfitting. Stumps force the progress to be gradual.
AdaBoost in scikit-learn
AdaBoostClassifier uses stumps by default. Its staged_predict method lets
us score the ensemble after every round in one pass — perfect for seeing how
accuracy builds up:
One stump manages a crude single cut; by a few dozen rounds the ensemble has
bent itself around both moons. Notice the shape of the curves: fast gains
early, then a long plateau — and if you push far enough on noisy data, the
test curve can start drifting back down while train keeps climbing. Unlike a
random forest, more boosting rounds is an overfitting axis, so
n_estimators needs validation.
The learning rate
learning_rate scales every learner's contribution before it's added to the
ensemble. It trades off against n_estimators:
- Small learning rate (0.1–0.5): each round corrects gently, so you need more rounds — but the ensemble is smoother and usually generalizes better.
- Learning rate near 1: aggressive corrections. Fewer rounds needed, but each round can over-commit to the current mistakes, and later rounds spend their effort fighting earlier over-corrections.
The standard recipe is shrink the learning rate, grow the round count, and pick the pair by validation.
AdaBoost's Achilles' heel: noisy labels
Re-weighting mistakes is a double-edged sword. A mislabeled sample or extreme outlier is, by definition, a sample every sensible learner gets "wrong" — so AdaBoost doubles down on it round after round until its weight dwarfs everything else, warping the boundary to chase one bad point. On noisy data, prefer a lower learning rate, fewer rounds, or a boosting method with a more forgiving loss (like gradient boosting with a robust loss).
Where AdaBoost sits in history
Freund and Schapire's AdaBoost (1997) was the proof that boosting worked outside of theory, and it earned them the Gödel Prize. A few years later, statisticians showed AdaBoost is a special case of a much more general recipe — gradient boosting, which reframes "focus on the mistakes" as gradient descent on any differentiable loss (AdaBoost corresponds to the exponential loss). That generalization, hardware-optimized as XGBoost and LightGBM, is what actually ships in production today. AdaBoost remains the best place to learn boosting, because you can see the mechanism — the weights — with your own eyes.
Check your understanding
Q1.What is the key difference between how bagging and boosting train their members?
Q2.After a round of AdaBoost, what happens to the weight of a sample the learner misclassified?
Q3.Why are decision stumps (depth-1 trees) a good base learner for AdaBoost?
Q4.A weak learner has weighted error ε = 0.5 (a coin flip). What vote weight α does AdaBoost give it?
Q5.Why is AdaBoost particularly sensitive to mislabeled samples?
Exercise: Stumps vs deeper base learners
On make_moons with noise=0.3, train two AdaBoost models with 150 rounds:
one with the default stumps (max_depth=1) and one whose base learner is a
DecisionTreeClassifier with max_depth=4. Plot both test-accuracy curves
(via staged_predict) on the same axes. Which base learner peaks higher, and
which one's test accuracy decays as rounds accumulate?
Next up: gradient boosting — the reframing of AdaBoost's idea as gradient descent on residuals, and its industrial-strength descendant, XGBoost.