title: customized transformerMixin with data labels in sklearn
body: <p>I'm working on a small project where I'm trying to apply SMOTE "Synthetic Minority Over-sampling Technique", where my data is imbalanced ..</p>
  
  <p>I created a customized transformerMixin for the SMOTE function .. </p>
  
  <pre><code>class smote(BaseEstimator, TransformerMixin):
      def fit(self, X, y=None):
          print(X.shape, ' ', type(X)) # (57, 28)   &lt;class 'numpy.ndarray'&gt;
          print(len(y), ' ', type)     #    57      &lt;class 'list'&gt;
          smote = SMOTE(kind='regular', n_jobs=-1)
          X, y = smote.fit_sample(X, y)
  
          return X
  
      def transform(self, X):
          return X
  </code></pre>
  
  <hr>
  
  <pre><code>model = Pipeline([
          ('posFeat1', featureVECTOR()),
          ('sca1', StandardScaler()),
          ('smote', smote()),
          ('classification', SGDClassifier(loss='hinge', max_iter=1, random_state = 38, tol = None))
      ])
      model.fit(train_df, train_df['label'].values.tolist())
      predicted = model.predict(test_df)
  </code></pre>
  
  <p>I implemented the SMOTE on the FIT function because I don't want it to be applied on the test data .. </p>
  
  <p>and unfortunately, I got this error:</p>
  
  <pre><code>     model.fit(train_df, train_df['label'].values.tolist())
    File "C:\Python35\lib\site-packages\sklearn\pipeline.py", line 248, in fit
      Xt, fit_params = self._fit(X, y, **fit_params)
    File "C:\Python35\lib\site-packages\sklearn\pipeline.py", line 213, in _fit
      **fit_params_steps[name])
    File "C:\Python35\lib\site-packages\sklearn\externals\joblib\memory.py", line 362, in __call__
      return self.func(*args, **kwargs)
    File "C:\Python35\lib\site-packages\sklearn\pipeline.py", line 581, in _fit_transform_one
      res = transformer.fit_transform(X, y, **fit_params)
    File "C:\Python35\lib\site-packages\sklearn\base.py", line 520, in fit_transform
      return self.fit(X, y, **fit_params).transform(X)
  AttributeError: 'numpy.ndarray' object has no attribute 'transform'
  </code></pre>