Each row is one column the tree may use at this node. The curve shows, for every possible cut, how much more separated the two sides would be than the node is now. The highest point is the cut it takes. Hover the curve.
A classification algorithm.
Press START and see it live.
The algorithm starts with a table of penguin data. Each row represents one penguin, while the columns contain information about it, such as its flipper length, bill length, and body mass. One column also gives the penguin's species. The algorithm uses the measurements to learn how to predict that species.
A decision tree sorts the penguins by asking simple yes-or-no questions. For example, it might ask whether a penguin's flipper is longer than a certain length. Penguins that meet the condition are placed in one group, while the rest are placed in another.
It tries different questions and chooses the one that separates the species best.
One tree can learn the training data too closely, including its random quirks. So instead, the algorithm builds many trees, each using a slightly different random sample of the penguins.
Some penguins may appear more than once in a sample, while others are left out. The ones left out can be used to check how well that tree works.
The trees are also made different in another way. At each step, a tree is only allowed to consider a few randomly chosen columns. It then chooses the best question it can from those columns, even if another column could have produced a better split.
So different trees may ask different questions, even when looking at similar penguins.
It splits, then does the same on both sides, and keeps going until a group holds one species only, or is too small to split, or the tree has grown as deep as it is allowed.
Then every tree is shown a penguin it never saw, and each one says which species it thinks it is. The answer with the most votes wins.
Because each tree saw different rows and different columns, they do not all get the same penguins wrong. That is the whole point of building many.
sample the rows → grow a tree → repeat → vote
Grow — decision trees on —. Each tree gets its own sample of the rows, and at every question may use only — of the columns, chosen at random.
The claim we are checking: the forest is right because its trees are wrong about different rows. If that holds, the forest will be right far more often than the average tree in it, and any two trees will disagree with each other a great deal.
The first 2 trees are shown question by question at reading speed. The rest are built at full speed.
Data · Palmer Penguins (Horst, Hill & Gorman), CC0. Bundled here as data/penguins.csv. Trees, bootstrap, Gini and out-of-bag scoring are all computed in this page — no library.
Each row is one column the tree may use at this node. The curve shows, for every possible cut, how much more separated the two sides would be than the node is now. The highest point is the cut it takes. Hover the curve.
Every box is a group of penguins. The colours show which species are in it, so a box of one colour holds one species. A thick outline means the tree stopped there. Hover any box.
One drawing per finished tree. Each tree has a different shape because each saw a different sample. The bar underneath is how often that tree alone is correct. Click a tree to open it.
—
—
Click any row in the strip above to see how the trees voted on it.