0
votes

Why the max_depth of every decision tree in my random forest classifier model are the same? I set the max_depth=30 of my RandomForestClassifier, and when I print each trees(trees = RandomForestClassifier.estimators_), I find every tree's max_depth are the same.

I really don't know where is the problem and how it happnend.

1
Please provide some code samples and a stacktrace if possible. - Frank
Maybe, you've set min_samples_leaf value, which doesn't allow to increase the depth - koPytok
You better provide the code, since the question is too general - koPytok

1 Answers

1
votes

If i am not mistaken, a decision tree is likely to reach its max depth. There is nothing wrong with it. I would even say that he surely will. The space you allow your tree to grow in, the space your tree will occupy.

Scaled to a random forest, again there is nothing wrong with it. You should focus on choosing the right max_depth, because with a grater max_depth comes a greater risk of over fitting.

Try different values and compare how you are doing with your test data.