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