scikit learn - Python Decision Trees - Creating a graphical representation of a decision tree which includes variable names -


i'm doing work using decision trees on python, using scikit learn. classifier works absolutely fine, when create graphical representation of this, instead of displaying variable names, x[0], x[1]...x[n] displayed variables, in scikit learn example: http://scikit-learn.org/stable/modules/tree.html. makes matters more difficult x[0] doesn't relate first column, x[1] second, etc, appears there's process going on in assigning variables new 'x-related' names.

how can either put variable names on graphical representation, map original variable names new counterparts, or ensure new variable names in order?

there argument of tree.export_graphviz() method called feature_names specify feature names, document says:

feature_names : list of strings, optional (default=none) names of each of features. 

the order of feature names order of features in feature vector train model.


Comments