title: mlextend plot_decision_regions with model fit on Pandas DataFrame?
body: <p>I'm a big fan of mlxtend's <code>plot_decision_regions</code> function, (<a href="http://rasbt.github.io/mlxtend/#examples" rel="nofollow noreferrer">http://rasbt.github.io/mlxtend/#examples</a> , <a href="https://stackoverflow.com/a/43298736/1870832">https://stackoverflow.com/a/43298736/1870832</a>)</p>
  
  <p>It accepts an <code>X</code>(just two columns at a time), <code>y</code>, and (fitted) classifier <code>clf</code> object, and then provides a pretty awesome visualization of the relationship between model predictions, true y-values, and a pair of independent variables. </p>
  
  <p>A couple restrictions:
  <code>X</code> and <code>y</code> have to be numpy arrays, and <code>clf</code> needs to have a <code>predict()</code> method. Fair enough. My problem is that in my case, the classifier <code>clf</code> object I would like to visualize has already been fitted on a Pandas DataFrame...</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  import xgboost as xgb
  
  import matplotlib
  matplotlib.use('Agg')
  from mlxtend.plotting import plot_decision_regions
  import matplotlib.pyplot as plt
  
  
  # Create arbitrary dataset for example
  df = pd.DataFrame({'Planned_End': np.random.uniform(low=-5, high=5, size=50),
                     'Actual_End':  np.random.uniform(low=-1, high=1, size=50),
                     'Late':        np.random.random_integers(low=0,  high=2, size=50)}
  )
  
  # Fit a Classifier to the data
  # This classifier is fit on the data as a Pandas DataFrame
  X = df[['Planned_End', 'Actual_End']]
  y = df['Late']
  
  clf = xgb.XGBClassifier()
  clf.fit(X, y)
  </code></pre>
  
  <p>So now when I try to use <code>plot_decision_regions</code> passing X/y as numpy arrays...</p>
  
  <pre><code># Plot Decision Region using mlxtend's awesome plotting function
  plot_decision_regions(X=X.values,
                        y=y.values,
                        clf=clf,
                        legend=2)
  </code></pre>
  
  <p>I (understandably) get an error that the model can't find the column names of the dataset it was trained on</p>
  
  <pre><code>ValueError: feature_names mismatch: ['Planned_End', 'Actual_End'] ['f0', 'f1']
  expected Planned_End, Actual_End in input data
  training data did not have the following fields: f1, f0
  </code></pre>
  
  <p>In my actual case, it would be a big deal to avoid training our model on Pandas DataFrames. Is there a way to still produce <code>decision_regions</code> plots for a classifier trained on a Pandas DataFrame? </p>