THE GENIUS PROJECT
๐ŸŒฒ Model deep dive ยท Machine learning model 1 of 3

Random Forest

๐Ÿ•’ About 14 minutes ๐Ÿ“Š Real NCB data ๐ŸŽฎ Grow-the-forest game
Sunlight falling through a path in a forest of tall trees

One person guessing can be badly wrong. A whole crowd guessing, then averaging, is often eerily accurate. That is the entire trick behind a random forest: grow hundreds of quick, rough decision trees, each a little different, and let them vote. Watch it happen below, tree by tree.

Start with one tree

A decision tree asks yes-or-no questions to split the data, then predicts the average of whatever lands in each group. A single quick tree is jumpy and often wrong, it overreacts to the exact days it happened to see. On its own, not much better than guessing.

Ensemble many models, averaged

An ensemble combines lots of weak models into one strong one. A random forest is an ensemble of decision trees: each tree sees a random slice of the data and makes a rough guess, and the forest reports their average. The random differences are the point, they cancel each other's mistakes.

Now grow the whole forest

Each new tree below is trained on a random re-sample of NCB's days with a random split point, so every tree is a little different (those faint gold steps). The bold gold line is the forest average. Keep adding trees and watch the jumpy individual guesses blend into one steady, sensible prediction.

How to play
  1. Press Add a tree a few times and watch each faint, jumpy guess appear.
  2. Then press Add 25 trees and watch the bold forest line settle down.
  3. Read the training error: it drops fast, then levels off. More trees stop helping once the crowd is big enough.
Press "Add a tree" to plant your first one.
โœ‹ Check your understanding
Why is a forest of many trees usually better than one tree?

What it is great at, and where it slips

๐Ÿ‘ Great for

A safe, strong first model on almost any table of features. It rarely overreacts and needs little tuning.

๐Ÿ‘Ž Slips when

You need to predict a value outside the range it has seen. Trees can only repeat past levels, so they cannot project a brand-new trend upward.

๐Ÿ’ก Use it on your own light bill

A forest is brilliant when your bill depends on several clues at once (month, number of people home, how many hot days). Each tree asks simple questions like "was it a hot month?" and the forest blends the answers. You will see this idea in the bonus light-bill challenge.

๐Ÿง  Recap
  • A random forest is a crowd of quick decision trees that vote and average.
  • Randomness makes each tree different, so their mistakes cancel out.
  • It is a safe, strong default, but it cannot extrapolate past the levels it has seen.

Next: gradient boosting, where each new tree fixes the last one's mistakes.