How is the Out-of-Bag prediction computed for an individual training instance?

Last updated 5 November 2026

  • For instance i, pass it only through trees whose bootstrap sample excluded i (about 37% of trees), then aggregate: majority vote or averaged probabilities for classification, mean for regression.

  • In-bag trees are excluded because they already fit i, which would leak the label and make error look optimistic.

  • If no tree has i out-of-bag (very few trees), i gets no OOB prediction and is dropped from the OOB score.

  • https://www.analyticsvidhya.com/blog/2021/05/bagging-25-questions-to-test-your-skills-on-random-forest-algorithm/
  • https://medium.com/@abhishekjainindore24/out-of-bag-evaluation-in-random-forest-6a4e57ebc485
  • https://www.youtube.com/watch?v=fXfs_6o_hOs
All Random Forests interview questions