100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Machine Learning with Scikit-learn
25 minintermediate

Bagging and Bootstrap Aggregation

Bagging — bootstrap aggregating — is the ensemble technique that reduces model variance by training multiple copies of the same algorithm on different bootstrap samples of the training data and averaging their predictions. It converts any high-variance, low-bias learner (such as a deep decision tree) into a stable ensemble by exploiting a fundamental statistical property: the average of multiple correlated predictions has lower variance than any single prediction, and the more independent those predictions are, the more variance is eliminated.

Understanding bagging deeply matters beyond random forests because it is the foundational principle underlying most ensemble methods. Gradient boosting explicitly builds on bagging's limitations, stacking learns how to combine predictions that bagging averages naively, and variance reduction through ensemble averaging is the mathematical core of why any ensemble outperforms its members. This lesson covers the mechanics of bootstrap sampling, the variance-reduction mathematics, the out-of-bag estimator, and the conditions under which bagging helps versus where it fails.

Analogy🏏Cricket
🏏 Think of it like cricket: A batting coach who teaches only one shot — the forward defensive — gives advice with high bias: it is consistently wrong for deliveries that demand a drive or a pull, regardless of how much practice the batsman does. A coach who memorises every ball of the batsman's training career gives advice with high variance: he predicts each training ball perfectly but fails completely on new balls from a different bowler, because he learned the noise of that specific bowler rather than the underlying principles. The great coach finds the balance — teaching the core principles that generalise, without over-specifying for the particular training environment. Just as great coaching lies between the extremes, great ML models balance bias and variance.
Lesson 19 of 35
0% complete