Algorithms Made Simple · 5 min read
One decision tree is easy to read but easy to overfit. A crowd of trees is harder to read and usually much more reliable.
A tree of questions
A decision tree predicts by asking a series of yes-or-no questions about the inputs, such as “Is the income above this value?” Each answer sends you down a branch until you reach a leaf with a prediction. Training chooses, at each step, the question that best separates the outcomes.
The weakness
Allowed to grow deep, a tree can carve out a separate leaf for nearly every training example. That fits the training data perfectly and generalizes poorly. Small changes in the data can also produce a quite different tree.
Random forests
A random forest trains many trees, each on a random resample of the data and with only a random subset of features considered at each split. The trees make different mistakes, and averaging their votes cancels much of the noise. This reduces overfitting without making each tree less flexible.
Boosting
Boosting builds trees one after another, each focusing on the examples the previous trees got wrong. Gradient-boosted trees are among the strongest methods for tables of data like spreadsheets, though they need more care with tuning.
Choosing
Use a single small tree when you must explain the rule to people. Use a forest or boosted trees when accuracy matters more. In either case, judge them on held-out data, not on the training score.
