Which Ensemble Method Relies on Bootstrap Aggregation?
Machine LearningModel answerLast updated
Pick the model that is a canonical example of bootstrap aggregating from four options, and justify the choice by explaining how bagging reduces variance.
Spotting the bagging method
You are reviewing ensemble learning techniques. Of the four models below, exactly one is a textbook example of bagging (bootstrap aggregating).
A. Random Forest B. Gradient Boosting C. Logistic Regression D. Support Vector Machine
What to provide
- Choose the correct option.
- Describe how bagging trains and combines its models.
- Explain why each of the other three options does not qualify.
- Discuss what bagging improves (bias or variance), when it helps most, and how you would validate that it is working.
State any assumptions you make about the task (classification or regression, dataset size, noise level).
Hints
Hint 1
Bagging means training many models independently on resampled versions of the data and then averaging or voting. Which option is built that way?
Hint 2
Ask of each remaining option: is it itself an ensemble? If so, are its members trained independently or one after another to fix earlier errors?
Hint 3
Think about which component of error (bias or variance) averaging many noisy but decorrelated models reduces, and how out-of-bag samples can be used to estimate performance.
Model answer
Easy Try it yourself first — then compare your approach, complexity and edge cases.
Answer
A. Random Forest.
How bagging works
Bagging (bootstrap aggregating) has three steps:
- Bootstrap: From a training set of size n, draw B new datasets, each of size n, by sampling with replacement. Each bootstrap sample contains roughly 63.2% of the unique original rows (the probability a given row is never picked is (1 − 1/n)^n, which approaches 1/e, about 36.8%).
- Train independently: Fit one base learner on each bootstrap sample. Because the fits do not depend on each other, they can run in parallel.
- Aggregate: Average the predictions for regression, or take a majority vote (or average predicted probabilities) for classification.
Random Forest follows exactly this recipe, using deep decision trees as base learners. It adds one more source of randomness: at every split, only a random subset of features is considered (commonly about sqrt(p) for classification, p/3 for regression). This makes the trees less correlated with one another, which strengthens the variance reduction.
Why bagging works: variance reduction
For B models, each with variance σ² and pairwise correlation ρ, the variance of their average is:
ρσ² + ((1 − ρ)/B) σ²
Increasing B shrinks the second term, but the first term remains. That is why decorrelating the learners matters: bootstrap resampling lowers ρ somewhat, and random feature selection lowers it further.
Consequences:
- Bagging mostly reduces variance and leaves bias roughly unchanged. It therefore pays off most with high-variance, low-bias learners such as fully grown decision trees.
- It gives little benefit for stable, high-bias learners (for example a linear model on a mostly linear problem), because their predictions barely change across bootstrap samples.
- Adding more trees does not cause overfitting in the usual sense. Performance plateaus, and extra trees only cost compute and memory.
Why the other options are wrong
- B. Gradient Boosting: This is an ensemble, but it is boosting, not bagging. Learners (usually shallow trees) are trained sequentially, each fitting the residual errors (negative gradient of the loss) of the current ensemble. It mainly reduces bias, is not trivially parallel across trees, and can overfit if you add too many rounds without regularization (learning rate, early stopping, subsampling).
- C. Logistic Regression: A single linear model for classification, fit by maximizing likelihood. It is not an ensemble at all. (You could bag logistic regressions, but the algorithm itself is not bagging.)
- D. Support Vector Machine: Also a single model, which finds a maximum-margin boundary, optionally with kernels. Again, not an ensemble method by itself.
Practical considerations
- Out-of-bag (OOB) evaluation: Each tree never sees about 36.8% of the rows. Predicting each row using only trees that did not train on it gives a nearly free, approximately unbiased validation estimate without a separate hold-out set. This is handy on small datasets.
- Hyperparameters to tune: number of trees, max depth or min samples per leaf, number of features per split, and bootstrap sample size.
- Interpretability: A forest is harder to interpret than a single tree. Feature importance (impurity-based or, preferably, permutation importance) offers partial insight. Impurity-based importance is biased toward high-cardinality features.
- Cost: Training scales linearly in the number of trees but parallelizes well. Inference requires evaluating every tree, so latency and model size can matter in production.
- Data issues: Random Forests tolerate noisy labels and outliers better than boosting, which tends to chase noisy points. They do not extrapolate beyond the range of training targets in regression. With severe class imbalance, use class weights or balanced bootstrap sampling.
How to validate it is working
- Compare a single deep tree and the forest on the same cross-validation folds. The forest should show a notably lower validation error and a smaller gap between train and validation scores.
- Plot OOB error against the number of trees and confirm it flattens.
- Check that the metric matches the objective (for example PR-AUC for imbalanced problems rather than accuracy).
Common mistakes
- Confusing bagging with boosting because both are tree ensembles. The key difference is parallel and independent versus sequential and error-correcting.
- Claiming bagging reduces bias. It primarily reduces variance.
- Forgetting that bootstrap sampling is with replacement.
- Assuming more trees will overfit.
- Treating the OOB score as a replacement for a final untouched test set when many hyperparameters have been tuned against it.
Summary
Random Forest is the classic bagging algorithm: independent trees on bootstrap samples, aggregated by averaging or voting, with extra feature randomness to decorrelate them. Gradient boosting is sequential boosting, and logistic regression and SVMs are single models.