Foundations — Out-of-bag error estimation
This page assumes you have seen nothing. Every letter, ratio, and squiggle in the parent note gets built here, one brick at a time, so that when you read the main OOB topic note every symbol is already an old friend.
0. What is a "dataset" and what does mean?
The picture: think of numbered cards laid in a row. Card carries a question () on the front and its correct answer () on the back.
Why the topic needs it: OOB error is measured per example, so we must be able to point at "example number " precisely. The subscript is that pointing finger.

1. Drawing "with replacement" — the heart of everything
The word bootstrap means: build a new sample of size by picking cards one at a time, and each time putting the card back before the next pick. Putting it back = "with replacement".
The picture: a jar of balls. You reach in, read a ball's number, drop it back, shake, and reach again — times total. Your new list may read for : ball 3 and ball 5 were never scooped.

Why the topic needs it: "with replacement" is the single mechanism that manufactures a free test set. No replacement → every card is picked exactly once → nothing is ever left out → no OOB. See Bootstrap Sampling.
2. Probability — reading
The picture: a pie sliced into equal wedges. One wedge = your card. Its slice of the whole pie is of the area.
Why the topic needs it: the famous "37% is out-of-bag" number is a probability. To earn it you must first be comfortable that "not this one card" .
3. Independent events → multiply
The picture: flip a coin twice. Chance of two heads . Each independent flip multiplies in a fresh factor.
Here the raised exponent is not magic notation — it literally means "multiply the same factor by itself times, once per draw".
Why the topic needs it: a whole bootstrap sample is draws. To leave card out we need it missed every single time — that "every time" is what turns the exponent into .
4. The number and the limit — why 37%?
The picture: plot against . As climbs, the dots flatten onto a horizontal line at about . They never wander off — they converge.

So ≈ 36.8% of cards fall out-of-bag per tree, and the rest, ≈ 63.2%, stay in-bag.
Why the topic needs it: this single ratio (37 out / 63 in) is the reason OOB is a usable test set. If only 1% were left out, each point would rarely be OOB and the estimate would be starved.
5. Sets and the symbols , , ,
The picture: a fenced pen () with a few numbered sheep inside. = "this sheep is inside the fence"; = "this sheep is outside"; = "count the sheep inside".
In the parent note, reads plainly as: " is the collection of tree-numbers such that example is not in tree 's bootstrap sample" — i.e. the trees for which is OOB.
Why the topic needs it: OOB prediction for a point only uses that point's own — the exact trees that never trained on it. Sets are how we name "just those trees".
6. Indexing the trees: , ,
The picture: a shelf of trained trees, each a little machine. Feed into machine and out drops a guess .
Why the topic needs it: the forest (Random Forests, built by Bootstrap Aggregating (Bagging)) is a collection of trees. Every OOB formula is a sum or vote over some subset of these machines.
7. Aggregation, loss, and the summation sign
The picture: is a conveyor belt: each example drops its loss onto the belt, and at the end you read the total — then divide by to get the average.
Why the topic needs it: the final OOB error is exactly this average loss: Every symbol in that line — , , , , — is now defined.

8. How it all snaps together
Read top-left to bottom-right: the with-replacement draw splits each tree's data into in-bag and out-of-bag; the probability chain explains why ~37% land out-of-bag; the set gathers each point's honest trees; aggregation + loss + turn those honest guesses into one number — the OOB error, a cheap stand-in for Cross-Validation that measures the test error of the forest.
Equipment checklist
Test yourself — cover the right side and answer aloud.