Created
February 11, 2020 22:15
-
-
Save kbfreder/81860c3c6eb9990649aca6809dd40c3a to your computer and use it in GitHub Desktop.
Retrieve tree depths
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import Random Forest | |
base_rf = RandomForestClassifier(n_estimators=100, max_depth=None) | |
base_rf.fit(train_X, train_y) | |
depths = [est.tree_.max_depth for est in base_rf.estimators_] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment