I am training a decision tree with sklearn. When I use:
dt_clf = tree.DecisionTreeClassifier()
the max_depth
parameter defaults to None
. According to the documentation, if max_depth
is None
, then nodes are expanded until all leaves are pure or until all leaves contain less than min_samples_split
samples.
After fitting my model, how do I find out what max_depth
actually is? The get_params()
function doesn't help. After fitting, get_params()
it still says None
.
How can I get the actual number for max_depth
?
Docs: https://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeClassifier.html