July 2019
Beginner to intermediate
740 pages
16h 52m
English
The decision tree we trained in the previous section performed pretty well; however, decision trees have a tendency to overfit, especially if we don't set limits on how far they can grow (with the max_depth and min_samples_leaf parameters). We can address this overfitting issue with a random forest, which is a bagging algorithm where we train many decision trees in parallel using bootstrap samples of our data and aggregate the output. In addition, we have the option of scoring each tree on the data in the training set that it didn't receive in its bootstrap sample, called out-of-bag samples, with the oob_score parameter.
Read now
Unlock full access