← Contents Volume VI · Lecture 13

Volume VI · Trees and Committees

13

Why a Crowd Beats an Expert

A single decision tree, grown deep enough to fit its training set exactly, has learned the data by heart rather than understood it. The fix is not a better tree. It is more trees — combined in one of two entirely different ways.

The mental model

Bagging and Random Forests build a crowd of roughly equal voters and average away their individual noise. Boosting builds a chain of specialists instead, each one trained specifically to cover the previous ones' mistakes. Same goal — reduce error beyond what one tree can reach — opposite mechanism.

One tree, too much memory

Lecture 12 built a decision tree by asking one greedy question after another, each one chosen to reduce impurity the most. Grown deep, such a tree can carve out a leaf for every training example — zero training error, and a model that has essentially memorised the sample rather than learned the pattern inside it. That is the textbook definition of high variance: retrain the same tree on a slightly different sample of the same population and you get a noticeably different tree, because a single tree has no mechanism for ignoring the noise specific to the sample it happened to see.

Both ideas in this lecture accept that a deep tree is a high-variance estimator and do nothing to make any individual tree less greedy. Instead they change what happens after the tree is grown — one by averaging over many such trees, the other by training many such trees in a deliberate sequence.

Bagging: many guesses, averaged

Bagging — bootstrap aggregating — is mechanically simple. From a training set of m examples, draw a new sample of size m with replacement: a bootstrap resample, which on average contains about two-thirds of the original examples, some of them more than once. Train a full, deep tree on that resample. Repeat B times, on B independently drawn resamples, and average the resulting predictions (a plain mean for regression, a majority vote for classification).

Plate 13.1 Draw bootstrap resamples one at a time from a fixed toy training set and watch the running fraction of originals retained converge toward the "about two-thirds" the lecture names — then flip to AdaBoost mode, where a single error-rate slider computes a real αₘ and reweights every example by the lecture's own exponential rule.
Bagged prediction fbag(x) = (1/B) Σb=1B fb(x),   each fb trained on an independent bootstrap resample of the training set

The reason this helps is a fact about variance, not a fact about trees specifically. Each individual fb is still exactly the high-variance estimator Lecture 12 warned about — bagging does nothing to tame any single tree. But the B trees were grown on different resamples, so their errors are only partially correlated with one another: where one tree overfits to noise present in its particular resample, another tree, trained on a different resample, is unlikely to overfit to the same noise in the same way. Averaging over many estimators whose errors are only partially correlated reduces the variance of the average below the variance of any one of them, without introducing new bias — the average of many unbiased-but-noisy guesses is still unbiased, and noticeably less noisy.

Random forests: decorrelating the crowd

Random Forests add exactly one further piece of randomness on top of bagging's bootstrap resampling: at each split, in each tree, the algorithm is only allowed to consider a random subset of the available features, rather than choosing freely among all of them. The split still picks the best available question from that restricted subset, by the same impurity-reduction rule as before — the restriction is on which features are even candidates, not on how the winner is chosen.

The reason this second layer of randomness earns its own name and its own paper is a correlation argument bagging's own reasoning did not anticipate. If one feature in the data is dramatically more predictive than the rest, then almost every bootstrap resample — no matter how it was drawn — will still support splitting on that same feature near the root, because the feature's predictive strength swamps the sampling noise. The bagged trees end up more correlated with one another than the variance argument in §13.2 assumed, which quietly erodes the benefit of averaging: correlated errors do not cancel the way independent ones do. Forcing each split to draw from only a random subset of features occasionally hides the dominant feature from a given split entirely, forcing that tree to discover a different, still-useful structure in the data. The trees decorrelate further, and the averaging step in §13.2 gets closer to its full theoretical benefit.

MANY ROUGHLY-EQUAL VOTERS tree 1 resample 1 tree 2 resample 2 ··· tree B resample B average
Figure 13a Many differently grown trees — each from its own bootstrap resample and, in a Random Forest, its own restricted feature subset at every split — averaged into a single final prediction. No tree is a specialist; every vote counts equally.

Boosting: a chain of specialists

AdaBoost abandons the averaging idea entirely and builds its ensemble as a sequence. Every training example starts with equal weight, wi = 1/N. Each round fits a weak learner — often a tree with a single split, a "stump" — to the currently weighted training set, then measures how badly that weak learner did, weights its vote by how well it did, and reweights the training examples so the next round is forced to pay more attention to exactly what this round got wrong.

AdaBoost, one round m errm = weighted error of Gm on the current weights
αm = log( (1 − errm) / errm )
wi ← wi · eαm · 1(yi ≠ Gm(xi))

Read the reweighting rule literally: the exponent is zero for any example Gm classified correctly, so its weight is untouched, and it is αm for any example Gm got wrong, so that example's weight is multiplied up by eαm — misclassified examples get heavier, and a weak learner that was already fairly accurate (small errm, large αm) upweights its mistakes especially hard. After M rounds, the final classifier is a weighted vote of every weak learner trained along the way:

Final AdaBoost prediction f(x) = sign( Σm=1M αm Gm(x) )

This reweighting scheme is not an ad hoc heuristic. It can be shown to be exactly equivalent to forward stagewise additive modelling under the exponential loss L(y, ŷ) = e−yŷ — at each round, AdaBoost is greedily adding the one weak learner and coefficient that most reduces the exponential loss on the current ensemble, holding everything fitted in previous rounds fixed. The weight update in the box above is what that greedy exponential-loss minimisation works out to in closed form.

A CHAIN OF SPECIALISTS G₁ fits the whole set G₂ focuses on G₁'s misses G₃ focuses on G₂'s misses ··· GM focuses on the last misses α₁G₁ + α₂G₂ + α₃G₃ + ··· f(x)
Figure 13b Each weak learner is recruited specifically to cover the region the previous ones got wrong; the final prediction is their weighted sum, not a plain average. Contrast the strictly sequential dependency here with the fully parallel, independent trees of Figure 13a.

From reweighting to gradients

Gradient boosting keeps AdaBoost's sequential structure — fit one weak learner, add it to the ensemble, repeat — but replaces the reweight-the-misclassified-examples mechanism with something more general. Instead of upweighting examples a previous round got wrong, each new weak learner is fit directly to the residuals of the current ensemble — or, more precisely, to the negative gradient of the loss function with respect to the ensemble's current predictions. Where AdaBoost's derivation is tied to one specific loss (exponential loss, as noted in §13.4), gradient boosting's functional-gradient-descent view works for any differentiable loss: squared error, absolute error, log-loss for classification, and beyond. AdaBoost is, in this sense, the special case of gradient boosting that falls out when the loss is fixed to be exponential.

Two crowds

The lecture's title is meant literally. Bagging and Random Forests build a crowd in the ordinary sense — many independently trained, roughly equal voters, whose collective judgment is simply their average. Boosting builds a different kind of crowd: a sequence of specialists, each one recruited for the specific job of covering the blind spots the previous specialists left behind. Both attack the weakness Lecture 12 diagnosed in a single deep tree, and both do so without asking any individual tree to be less greedy — they change what surrounds the tree, not the tree itself.

Read the primary source