title: Display more attributes in the decision tree
body: <p>I am currently viewing the decision tree using the following code.  Is there a way that we can export some calculated fields as output too?</p>
  
  <p>For example, is it possible to display the sum of an input attribute at each node, i.e. sum of feature 1 from 'X' data array in the leafs of the tree.</p>
  
  <pre><code>from sklearn import datasets
  
  iris = datasets.load_iris()
  X = iris.data[:]  
  y = iris.target
  #%%
  from sklearn.tree import DecisionTreeClassifier
  alg=DecisionTreeClassifier( max_depth=5,min_samples_leaf=2, max_leaf_nodes = 10)
  alg.fit(X,y)
  
  #%%
  ## View tree
  import graphviz
  from sklearn import tree
  dot_data = tree.export_graphviz(alg,out_file=None, node_ids = True, proportion = True, class_names = True, filled = True, rounded = True)
  graph = graphviz.Source(dot_data)
  graph
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/rKDsy.png" rel="noreferrer"><img src="https://i.stack.imgur.com/rKDsy.png" alt="enter image description here"></a></p>