A built-in validation method for ensemble models using bootstrap sampling's unused data.
Out-of-bag (OOB) evaluation is a model validation technique native to ensemble methods that use bootstrap sampling, most notably random forests. When training each tree in a random forest, only a bootstrapped subset of the training data is used — roughly 63.2% of observations on average, drawn with replacement. The remaining ~36.8% of samples that were not selected for a given tree are called "out-of-bag" samples for that tree. Because these samples played no role in fitting the tree, they can serve as an unbiased test set for evaluating its predictions.
The mechanics are straightforward: for each observation in the dataset, predictions are collected only from the trees for which that observation was out-of-bag. These predictions are then aggregated — averaged for regression, majority-voted for classification — to produce a single OOB prediction per data point. Comparing these OOB predictions against the true labels yields the OOB error, a reliable estimate of generalization performance that requires no separate held-out validation set.
What makes OOB evaluation particularly valuable is its efficiency. In settings where labeled data is scarce, carving out a dedicated validation split is costly. OOB evaluation sidesteps this trade-off entirely: every observation contributes to both training (for the trees that include it) and validation (for the trees that don't), making full use of available data. The resulting error estimate has been shown empirically to closely approximate the error obtained from proper cross-validation, often at a fraction of the computational cost.
Beyond simple error estimation, OOB samples also underpin other diagnostics in random forests, including feature importance scores and proximity matrices. The technique became a standard component of the random forest framework as formalized by Leo Breiman around 1996–2001, and it remains a default evaluation strategy in most modern implementations. For practitioners, OOB evaluation offers a convenient, built-in sanity check that is especially useful during rapid prototyping or when working with limited datasets.