forest() — Random forests

Averages many random trees to cut variance.

forest(trees, depth, X, y)

Key idea

Definition

how many trees in the forest
tree b, grown on a bootstrap resample
the averaged prediction

In plain words

One opinionated tree is shaky. Ask a thousand slightly different trees and average them, and the wobble disappears.

Where you'd use it

Frequently asked questions

Why is a random forest better than one tree?
Averaging many varied trees cuts variance and lifts accuracy — at the cost of interpretability.