title: 'Length of feature names doesn't match with number of features' error while plotting decision tree using Graphviz
body: <p>I am trying to visualize a decision tree using graphviz and while trying to plot the decision tree I am getting the below error :</p>
  
  <pre><code>~\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\tree\export.py in export_graphviz(decision_tree, out_file, max_depth, feature_names, class_names, label, filled, leaves_parallel, impurity, node_ids, proportion, rotate, rounded, special_characters, precision)
      427                                  "does not match number of features, %d"
      428                                  % (len(feature_names),
  --&gt; 429                                     decision_tree.n_features_))
      430 
      431         # The depth of each node for plotting with 'leaf' option
  
  ValueError: Length of feature_names, 225 does not match number of features, 
  </code></pre>
  
  <p>208</p>
  
  <p><strong>My code</strong></p>
  
  <pre><code>dt=DecisionTreeClassifier(class_weight="balanced", min_samples_leaf=30)
  fit_decision=dt.fit(X_train_res,y_train_res)
  from graphviz import Source
  from sklearn import tree
  Source( tree.export_graphviz(fit_decision, out_file=None, feature_names=data.columns))
  </code></pre>
  
  <p>Can you tell me what went wrong?</p>