Rows left out of a tree's bootstrap sample provide an internal prediction check.
Out-of-bag evaluation uses only trees that did not train on a particular row. It is convenient, but it should not be treated as a magical replacement for every validation design.
Read the OOB matrix
Matrix question
For row A, which trees are allowed to predict its OOB estimate?
| Training row | Tree 1 | Tree 2 | Tree 3 | Tree 4 | Tree 5 |
|---|---|---|---|---|---|
| A | In | OOB | In | OOB | OOB |
| B | OOB | In | OOB | In | OOB |
| C | In | OOB | OOB | In | In |
| D | OOB | In | In | OOB | In |
Read the row: row A's OOB prediction uses Trees 2, 4, and 5. Tree 1 and Tree 3 must be excluded because they trained on A.
One OOB prediction step by step
Aggregation question
Trees 2, 4, and 5 give row A probabilities 0.70, 0.40, and 0.80 for the positive class. What is the OOB probability?
Repeat this for every row using only its OOB trees, then calculate an OOB metric. With enough trees, most rows receive many OOB predictions.
OOB versus a held-out test set
OOB estimates are useful during exploration and can help monitor the effect of adding trees. A clean validation or test design remains important, especially for time-dependent data, grouped observations, repeated tuning, or a small dataset.