EasyDeepLearn

What is the out-of-bag (OOB) score in Random Forests?

medium

Answer

  • Each bootstrap sample leaves out ~37% of the training data (untouched by that tree).
  • For each training point x, aggregate predictions from the trees where x was NOT in-bag; compare to y.
  • This gives an internal estimate of generalization error at zero extra cost, roughly equivalent to a k-fold CV score, and lets you tune nestimatorsn_{\mathrm{estimators}} without a separate held-out set.
  • Enable with oobscore=True\mathrm{oob}_{\mathrm{score}} = \mathrm{True} in scikit-learn's RandomForestClassifier/Regressor.
Check yourself — multiple choice
  • An error estimated on the training set
  • Error on samples not seen by each tree — a free ~CV-quality estimate
  • Error only on the held-out test set
  • An error only for regression trees

OOB uses the ~37% left out of each bootstrap ⇒ nearly-free CV estimate.

#random-forest#bagging#evaluation

Practise Supervised Learning

215 interview questions in this topic.

Related questions