All lessons in Machine Learning Engineering: Reliable Predictive Models

Out-of-Bag Evaluation: Correct Votes and Limits

Aggregate only eligible trees for each row and decide when OOB cannot answer the deployment question.

35 minutes · Members lesson · preview

What you will learn

  • Compute the probability that a bootstrap sample excludes a given row and the expected number of eligible trees for that row.
  • Reconstruct an out-of-bag probability for one row using only the trees whose bootstrap sample excluded it, and state how to handle rows with no eligible tree.
  • Decide when an out-of-bag score answers the deployment question for late-delivery forecasting and when a time, group, or sealed holdout is required instead.

A random forest trains each tree on a bootstrap sample: n rows drawn with replacement from n training rows. Because draws repeat, every tree leaves out a sizeable slice of the training data. Those left-out rows are a free source of test-like predictions, and the resulting out-of-bag (OOB) score is often quoted as if it settles the question of how well the forest will work. For our parcel carrier, which predicts at dispatch whether a parcel will arrive late, the OOB score is useful internal evidence, but it is built under one specific sampling assumption, and the lesson is about where that assumption stops matching the real forecasting job.

Choose another lesson