title: How to make Python decision tree more understandable?
body: <p>I have a data file. The last column of the data has +1 and -1 distinguishing variables. I also have the id names of each column in a separate file.</p>
  
  <p>e.g.</p>
  
  <pre><code>1 2 3 4 1
  5 6 7 8 1
  9 1 2 3 -1
  4 5 6 7 -1
  8 9 1 2 -1
  </code></pre>
  
  <p>and for each column I have Q1, Q2, Q3, Q4, Q5 names respectively.</p>
  
  <p>I want to implement decision tree classifier so I wrote the following code:</p>
  
  <pre><code>import numpy
  from sklearn import tree
  
  print('Reading data from ' + fileName);
  data = numpy.loadtxt(fileName);
  print('Getting ids from ', idFile)
  idArray = numpy.genfromtxt('cleanedID.csv', dtype='str')
  
  print('Adding ids')
  print('data dimensions: ', data.shape)
  print('idArray dimensions: ', idArray.shape)
  data = numpy.append(idArray, data, axis = 0)
  
  
  y = data[:,-1]
  x = data[:, 1:-1]
  
  classifier = tree.DecisionTreeClassifier(max_depth = depth)
  classifier = classifier.fit(x, y)
  
  with open('graph.dot', 'w') as file:
      tree.export_graphviz(classifier, out_file = file)
  
  file.close()
  </code></pre>
  
  <p>I used graphviz to convert .dot file to .png file.</p>
  
  <p>The problem is that the decision tree which looks something like:
  <a href="https://i.stack.imgur.com/i5Pmu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i5Pmu.png" alt="enter image description here"></a></p>
  
  <p>I don't get what X[number] means. I searched and found that value = [5 0] means class 5 has 0 objects and class 0 has 5 objects but I have only +1 and -1 distinguishing variables. Is there anyway I can tweak this decision tree so that I can see the column names (Q1, Q2, Q3....) in the decision tree picture so I can understand that what this means?</p>
  
  <p>Thanks</p>