Out-of-bag testing
Random forests offer the benefit of built-in cross-validation because individual trees are trained on bootstrapped versions of the training data. As a result, each tree uses on average only two-thirds of the available observations. To see why, consider that a bootstrap sample has the same size, n, as the original sample, and each observation has the same probability, 1/n, to be drawn. Hence, the probability of not entering a bootstrap sample at all is (1-1/n)n, which converges (quickly) to 1/e, or roughly one-third.
This remaining one-third of the observations that are not included in the training set used to grow a bagged tree is called out-of-bag (OOB) observations and can serve as a validation set. Just as with cross-validation, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access