'Transform data by adding two synthetic feature(s).
Parameters
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
X_transformed: array-like, shape (n_samples, n_features + 1) or (n_samples, n_features + 1 + n_classes) for classifier with predict_proba attribute
The transformed feature set.'

def transform(self, X):

    X = check_array(X)
    X_transformed = np.copy(X)
    if (issubclass(self.estimator.__class__, ClassifierMixin) and hasattr(self.estimator, 'predict_proba')):
        X_transformed = np.hstack((self.estimator.predict_proba(X), X))
    X_transformed = np.hstack((np.reshape(self.estimator.predict(X), ((-1), 1)), X_transformed))
    return X_transformed
