title: All intermediate steps should be transformers and implement fit and transform
body: <p>I am implementing a pipeline using important features selection and then using the same features to train my random forest classifier. Following is my code.</p>
  
  <pre><code>m = ExtraTreesClassifier(n_estimators = 10)
  m.fit(train_cv_x,train_cv_y)
  sel = SelectFromModel(m, prefit=True)
  X_new = sel.transform(train_cv_x)
  clf = RandomForestClassifier(5000)
  
  model = Pipeline([('m', m),('sel', sel),('X_new', X_new),('clf', clf),])
  params = {'clf__max_features': ['auto', 'sqrt', 'log2']}
  
  gs = GridSearchCV(model, params)
  gs.fit(train_cv_x,train_cv_y)
  </code></pre>
  
  <p>So <code>X_new</code>are the new features selected via <code>SelectFromModel</code> and <code>sel.transform</code>. Then I want to train my RF using the new features selected. </p>
  
  <p>I am getting the following error:</p>
  
  <blockquote>
    <p>All intermediate steps should be transformers and implement fit and
    transform, ExtraTreesClassifier ...</p>
  </blockquote>