Solution
= Solution
The loop performs <Leave-one-out cross-validation>: for each $i$ it fits a forest to the other eight observations, tests it on observation $i$, and averages the nine zero-one losses. A random forest's <out-of-bag error estimate> approximates the same held-out prediction error from one fit, because each tree automatically omits roughly a proportion $e^{-1}$ of the observations in its <bootstrap sample>.