title: feature names from sklearn pipeline: not fitted error
body: <p>I'm working with scikit learn on a text classification experiment. Now I would like to get the names of the best performing, selected features. I tried some of the answers to similar questions, but nothing works. The last lines of code are an example of what I tried. For example when I print <code>feature_names</code>, I get this error: <code>sklearn.exceptions.NotFittedError: This SelectKBest instance is not fitted yet. Call 'fit' with appropriate arguments before using this method.</code>
  Any solutions?</p>
  
  <pre><code>scaler = StandardScaler(with_mean=False) 
  
  enc = LabelEncoder()
  y = enc.fit_transform(labels)
  
  feat_sel = SelectKBest(mutual_info_classif, k=200)  
  clf = linear_model.LogisticRegression()
  
  pipe = Pipeline([('vectorizer', DictVectorizer()),
                   ('scaler', StandardScaler(with_mean=False)),
                   ('mutual_info', feat_sel),
                   ('logistregress', clf)])
  
  feature_names = pipe.named_steps['mutual_info']
  X.columns[features.transform(np.arange(len(X.columns)))]
  </code></pre>