Classical & Statistical Learning

random forest

/ RAN-dum FOR-ist /

A random forest takes the wisdom of crowds and applies it to decision trees. One tree, as we've seen, is clever but jittery — it overfits and overreacts to small wobbles in the data. So instead of trusting one expert, you grow hundreds of trees, each trained on a slightly different slice of the problem, and let them vote. The errors of individual trees tend to be different and cancel out, while their shared, correct signal survives the vote. The forest is far steadier than any tree inside it.

Two doses of randomness keep the trees from being clones. First, each tree is trained on a random resample of the data (drawn with replacement, so some rows repeat and others are left out) — a technique called bagging. Second, at every split each tree is only allowed to consider a random subset of the features. This deliberate disagreement is the secret: trees that always made the same mistakes would vote in lockstep and cancel nothing. By forcing them to be different, the forest turns their individual flaws into collective strength.

The payoff is a model that is accurate, robust, and almost shrugs off overfitting, with little tuning needed — which is why it's a default first choice for everyday tabular data in business and science. The price is that you trade away the single tree's readability: a forest of 500 trees is no longer a flowchart you can eyeball, though it can still rank which features mattered most. It also won't conjure patterns that aren't in the data — it's a sturdy averager, not a magician.

To predict whether a customer churns, you grow 500 trees, each on a random resample of subscribers and a random handful of features. A new customer's profile runs through all 500: 340 trees say "will leave," 160 say "will stay." The forest reports churn, with a confidence of 340/500 = 68%.

Hundreds of imperfect trees voting — disagreement is the feature, not the bug.

Random forests reduce overfitting by averaging away the variance of individual trees, but they can't fix a deep flaw in the data — feed every tree the same bias and the forest will faithfully average that bias. They predict in parallel (bagging); contrast that with boosting, where trees are built one after another to fix each other's mistakes.

Also called
random decision forest随机森林隨機森林