title: How to get node information on Spark Decision Tree model
body: <p>I'd like to have more detailed information on each node of the generated model by Spark MLlib's Decision Tree. The closest I could get using the API is <code>print(model.toDebugString())</code>, which returns something like this (taken from the PySpark doc)</p>
  
  <pre><code>  DecisionTreeModel classifier of depth 1 with 3 nodes
    If (feature 0 &lt;= 0.0)
     Predict: 0.0
    Else (feature 0 &gt; 0.0)
     Predict: 1.0
  </code></pre>
  
  <p>How can I modify the MLlib source code in order to get, for instance, the impurity and depth of each node? (and if necessary, how can I call the new Scala function in PySpark?)</p>