The data are noisy values of sin(2πx) (gold curve). A regression tree cuts the x-axis into intervals and predicts the mean of the targets in each; grown deep it follows the noise. Bagging fits the same model to M bootstrap samples (faint lines) and averages them (teal): the committee. The errors are measured against the true function: EAV is the average error of the members (14.10), ECOM the error of their average (14.11). Averaging always helps, ECOM ≤ EAV, but by much less than the factor 1/M of (14.14), because members fitted to overlapping bootstrap samples make correlated errors.
EAV − ECOM = (1/M) ∑m Ex[(ym(x) − yCOM(x))2], the spread of the members around their average, so the committee gains exactly as much as its members disagree (Exercise 14.3). Expectations over x are averages over 400 equally spaced points in (0, 1).
grow_tree, prune_tree, pruning_path, bagging, fit_polynomial, committee_errors); checks in code/checks_ch14.py.