September 2019
Intermediate to advanced
420 pages
10h 29m
English
Random forests are already pretty arbitrary. But what if we wanted to take the randomness to its extreme?
In extremely randomized trees (see the ExtraTreesClassifier and ExtraTreesRegressor classes), the randomness is taken even further than in random forests. Remember how decision trees usually choose a threshold for every feature so that the purity of the node split is maximized? Extremely randomized trees, on the other hand, choose these thresholds at random. The best one of these randomly generated thresholds is then used as the splitting rule.
We can build an extremely randomized tree as follows:
In [16]: from sklearn.ensemble import ExtraTreesClassifier... extra_tree = ExtraTreesClassifier(n_estimators=10, ...
Read now
Unlock full access