Bagging, short for bootstrap aggregating, builds several learners on random samples drawn from a dataset with replacement, then combines their predictions. Classification uses a vote; regression uses an average. section 12.1 section 12.7
A bagging procedure:
- Draw random subsets from the dataset with replacement; some points may appear in multiple subsets, while others may be left out. section 12.1
- Train a separate learner on each subset, then combine their predictions by voting for classification or averaging for regression. section 12.1
Spam and ham emails
A random forest can combine decision trees trained on samples of emails described by counts of “lottery” and “sale.” In a manual illustration, three trees vote; a Scikit-Learn example fits a forest of five depth-1 trees. section 12.2
Figure 12.1 Ensemble methods consist of joining several weak learners to build a strong learner.
The figure illustrates how several weak learners combine into a strong learner. section 12.1



