Contrast bagging and boosting: what error each reduces, how they are trained, and their failure modes.
Answer
Model answer, written in a candidate's voice
In short
- Bagging: independent bootstrap-sample models, averaged/voted; RF adds random feature subsampling; mainly reduces variance.
- Boosting: sequential additive learners fit residuals or gradients; mainly reduces bias.
- Failure modes: bagging leaves systematic bias/underfit; boosting overfits noise and is sensitive to labels, outliers, and hyperparameters.
- Bagging is robust and easy to parallelise; boosting is sequential and hyperparameter-sensitive.
- Practical defaults: GBDT for tabular data; RF as a strong baseline.
In full
Bagging and boosting both build ensembles, but they attack different errors: bagging trains many models independently on bootstrap resamples and averages or votes their predictions, so it mainly reduces variance, and random forests add random feature subsampling to decorrelate trees. Boosting trains models sequentially, with each new learner fitting the residuals or negative gradients of the loss from the current ensemble, so it mainly reduces bias. The trade-off is failure mode: bagging is robust and easy to parallelise but will not remove systematic bias or an underfit base learner, while boosting can overfit noise and is sensitive to label noise, outliers, learning rate, depth, and number of trees. In practice I would use a random forest as a strong, stable baseline and gradient boosting/GBDT as the default for tabular data when accuracy matters, with careful validation and regularisation.
What a strong answer covers
- Bagging: parallel models on bootstrap samples, averaged, mainly reduces variance (random forest adds feature subsampling).
- Boosting: sequential models that fit residuals or gradients, mainly reduce bias, can overfit noise.
- Boosting is more sensitive to label noise and hyperparameters; bagging is robust and easy to parallelise.
- Practical defaults: GBDT for tabular data; RF as a strong baseline.
Common mistakes
- saying boosting reduces variance
- claiming random forests cannot overfit.