One model makes one set of mistakes. A crowd of models, each a little different, makes mistakes that partly cancel out. Build a crowd live and see why it usually wins.
These are the first seven models of the current ensemble, each drawn on its own, followed by the combined vote. In bagging, every tree sees a random bootstrap sample (hollow dots were left out). In boosting, each tree is trained on re-weighted data: big dots are the points earlier trees got wrong. Notice how weak the individuals look next to the ensemble.
Test accuracy as you add models, for each method on the same data and tree depth. The single tree is a flat line, since it never changes. Bagging climbs and levels off as variance is averaged away. Boosting keeps correcting mistakes and can climb higher, but on very noisy data it may start chasing noise. Click the chart to set the number of models.
Bagging attacks variance: deep trees overfit in different ways, and averaging them cancels the wobble. Boosting attacks bias: shallow stumps are too simple alone, and stacking them step by step builds a flexible boundary. This table runs all three methods with your current depth and number of models. Click a row to use it.
Other ensembles follow the same idea: random forests add random features to bagging, and stacking trains a final model to blend different models' outputs. What matters is that the members are accurate and different from one another.
Noisy moons and a deep single tree. It threads every training point, so train accuracy is high but test accuracy drops.
Keep the same data and deep trees, but vote with 40 bootstrap trees. The wobbly boundary smooths out and test accuracy rises.
Use depth-1 stumps, which are too simple alone. Forty boosted stumps build a much better curved boundary.