freecoding.school100% FREE · NO SIGNUP
Tensor TownISSUE #15 of 120

random forests · ensemble of trees

NeuraVSThe Overfit Ogre
Neura saysRandom forests average many decision trees to cut overfitting and boost accuracy.

A random forest trains many trees on random subsets of data and features, then averages (or votes) their predictions. This bagging averages away individual trees' overfitting, giving a robust, accurate model that needs little tuning. You lose the single readable tree, but gain stability and feature-importance estimates. A reliable go-to for tabular data.

Power-ups you unlock

The Overfit Ogre attacks — common mistakes

Boss battleExplain how averaging many trees reduces overfitting.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>100 trees, each on random data/features
average their votes → individual overfit cancels out
→ robust, accurate</pre></body></html>
▶ Open the interactive comic issue
‹ Decision Trees · Gini · EntropyGradient Boosting · Xgboost · Lightgbm ›