Prediction averaging combines multiple models to produce one prediction. For regression, it averages outputs; for classification, it uses majority voting. The models differ because they train on different samples, features, or both, making the combined estimate more reliable than a single model. section 5.1.1
Common averaging strategies differ in how they vary the training data:
- Pasting trains models on subsamples drawn without replacement, then pools their predictions. section 5.1.1
- Bagging uses bootstrapped samples, or sampling with replacement, to create diverse models. section 5.1.1
- Random subspaces sample features, while random patches sample both training examples and features. section 5.1.1
- These approaches primarily reduce prediction variance, although sampling can increase bias by excluding parts of the data distribution and can raise computational cost. section 5.6
Table 5.1 Bagging and sampling strategies (view table figure)
| Averaging strategy |
What happens to data |
Parameters for BaggingClassifier/BaggingRegressor |
|---|---|---|
| Pasting |
Training examples are sampled without replacement |
bootstrap = False max_samples < 1.0 max_features = 1.0 |
| Bagging |
Training examples are sampled with replacement (bootstrapping) |
bootstrap = True max_samples = 1.0 max_features = 1.0 |
| Random subspaces |
Features are sampled (without replacement) |
bootstrap = False max_samples = 1.0 max_features < 1.0 |
| Random patches |
Training examples and features are sampled without replacement |
bootstrap = False max_samples < 1.0 max_features < 1.0 |
Compare pasting, bagging, random subspaces, and random patches through their sampling choices and BaggingClassifier or BaggingRegressor parameters. section 5.1.1
A bagged tree classifier
A practical implementation uses scikit-learn's BaggingClassifier with a DecisionTreeClassifier, 300 estimators, bootstrap sampling, and five-fold shuffled cross-validation. The reported result is 0.809 accuracy, with fit and prediction timings included, making both predictive performance and operating cost visible. section 5.1.1

