What is bagging (bootstrap aggregating)?

Quick Overview

Explain bagging (bootstrap aggregating): how bootstrap samples and aggregation build an ensemble, which part of prediction error it reduces, and which base learners benefit. It tests the bias-variance trade-off, why correlated models limit the gain, and how bagging differs from boosting.

What is bagging (bootstrap aggregating)?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

What is bagging (bootstrap aggregating)? Explain how it builds an ensemble and which part of a model's prediction error it reduces. ```hint Where the gain comes from Think about the bias-variance decomposition, and ask which term shrinks when you average many models trained on slightly different data. ``` ### What a Strong Answer Covers - How the bootstrap samples are drawn, how the base models are fit, and how their predictions are combined for regression and for classification. - Which component of error bagging reduces, and which it leaves roughly unchanged. - Which base learners benefit from bagging and which barely change. - Why correlation between the bagged models limits the gain, and how Random Forest responds to it. - How bagging differs from boosting. ### Follow-up Questions - About what fraction of the distinct training rows ends up in one bootstrap sample, and how can the rows left out be used? - If each of $B$ models has variance $\sigma^2$ and pairwise correlation $\rho$, what is the variance of their average, and what happens as $B$ grows? - Why does bagging linear regression or k-NN with a large k add almost nothing? - Bagged models can be trained in parallel. Why can boosting not be parallelized across models the same way?

Overview: Explain bagging (bootstrap aggregating): how bootstrap samples and aggregation build an ensemble, which part of prediction error it reduces, and which base learners benefit. It tests the bias-variance trade-off, why correlated models limit the gain, and how bagging differs from boosting.

PracHub logo
General
Nov 24, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

What is bagging (bootstrap aggregating)? Explain how it builds an ensemble and which part of a model's prediction error it reduces.

What a Strong Answer Covers Guidance

  • How the bootstrap samples are drawn, how the base models are fit, and how their predictions are combined for regression and for classification.
  • Which component of error bagging reduces, and which it leaves roughly unchanged.
  • Which base learners benefit from bagging and which barely change.
  • Why correlation between the bagged models limits the gain, and how Random Forest responds to it.
  • How bagging differs from boosting.

Follow-up Questions Guidance

  • About what fraction of the distinct training rows ends up in one bootstrap sample, and how can the rows left out be used?
  • If each of BB models has variance σ2\sigma^2 and pairwise correlation ρ\rho , what is the variance of their average, and what happens as BB grows?
  • Why does bagging linear regression or k-NN with a large k add almost nothing?
  • Bagged models can be trained in parallel. Why can boosting not be parallelized across models the same way?