What is out-of-bag (OOB) error in Random Forest?

Updated May 16, 2026

Short answer

OOB error estimates model performance using samples not included in bootstrap training sets.

Deep explanation

In bagging-based models like Random Forest, each tree is trained on a bootstrap sample, leaving out about 36% of data on average. These unused samples are called out-of-bag samples. OOB error is computed by aggregating predictions for each sample using only trees that did not see that sample during training, providing an unbiased validation estimate without a separate validation set.

Real-world example

Used in production systems to estimate model performance without cross-validation.

Common mistakes

  • Assuming OOB error replaces test sets completely.

Follow-up questions

  • Why is OOB error efficient?
  • Is OOB always reliable?

More Ensemble Learning interview questions

View all →