title: ValueError When Plotting With Partial Dependence Using Scikit Learn
body: <p>I tried to follow the example from <a href="https://scikit-learn.org/stable/auto_examples/plot_partial_dependence_visualization_api.html#sphx-glr-auto-examples-plot-partial-dependence-visualization-api-py" rel="nofollow noreferrer">Scikit-Learn site</a></p>
  
  <pre class="lang-py prettyprint-override"><code>print(__doc__)
  
  import pandas as pd
  import matplotlib.pyplot as plt
  from sklearn.datasets import load_boston
  from sklearn.neural_network import MLPRegressor
  from sklearn.preprocessing import StandardScaler
  from sklearn.pipeline import make_pipeline
  from sklearn.tree import DecisionTreeRegressor
  from sklearn.inspection import plot_partial_dependence
  
  boston = load_boston()
  X = pd.DataFrame(boston.data, columns=boston.feature_names)
  y = boston.target
  
  tree = DecisionTreeRegressor()
  mlp = make_pipeline(StandardScaler(),
                      MLPRegressor(hidden_layer_sizes=(100, 100),
                                   tol=1e-2, max_iter=500, random_state=0))
  tree.fit(X, y)
  mlp.fit(X, y)
  
  fig, ax = plt.subplots(figsize=(12, 6))
  ax.set_title("Decision Tree")
  tree_disp = plot_partial_dependence(tree, X, ["LSTAT", "RM"])
  </code></pre>
  
  <p>But I got an error</p>
  
  <pre><code>Automatically created module for IPython interactive environment
  ---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  ~\Anaconda3\lib\site-packages\sklearn\inspection\partial_dependence.py in convert_feature(fx)
      523             try:
  --&gt; 524                 fx = feature_names.index(fx)
      525             except ValueError:
  
  ValueError: 'LSTAT' is not in list
  
  During handling of the above exception, another exception occurred:
  
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-8-2bdead960e12&gt; in &lt;module&gt;
       23 fig, ax = plt.subplots(figsize=(12, 6))
       24 ax.set_title("Decision Tree")
  ---&gt; 25 tree_disp = plot_partial_dependence(tree, X, ["LSTAT", "RM"])
  
  ~\Anaconda3\lib\site-packages\sklearn\inspection\partial_dependence.py in plot_partial_dependence(estimator, X, features, feature_names, target, response_method, n_cols, grid_resolution, percentiles, method, n_jobs, verbose, fig, line_kw, contour_kw)
      533             fxs = (fxs,)
      534         try:
  --&gt; 535             fxs = [convert_feature(fx) for fx in fxs]
      536         except TypeError:
      537             raise ValueError('Each entry in features must be either an int, '
  
  ~\Anaconda3\lib\site-packages\sklearn\inspection\partial_dependence.py in &lt;listcomp&gt;(.0)
      533             fxs = (fxs,)
      534         try:
  --&gt; 535             fxs = [convert_feature(fx) for fx in fxs]
      536         except TypeError:
      537             raise ValueError('Each entry in features must be either an int, '
  
  ~\Anaconda3\lib\site-packages\sklearn\inspection\partial_dependence.py in convert_feature(fx)
      524                 fx = feature_names.index(fx)
      525             except ValueError:
  --&gt; 526                 raise ValueError('Feature %s not in feature_names' % fx)
      527         return int(fx)
      528 
  
  ValueError: Feature LSTAT not in feature_names
  </code></pre>
  
  <p>Did I do something wrong or the tutorial is not working anymore?. I have tried to plot the partial dependency on my random forest model but got the same error.</p>
  
  <p>Any bits of help is appreciated</p>
  
  <p>Update: All of the error logs</p>