'Learn and apply the dimension reduction on the train data.
Parameters
X : array-like, shape = [n_samples, n_features]
Training vectors, where n_samples is the number of samples and
n_features is the number of predictors.
y : array-like, shape = [n_samples, n_targets]
Target vectors, where n_samples is the number of samples and
n_targets is the number of response variables.
Returns
x_scores if Y is not given, (x_scores, y_scores) otherwise.'

def fit_transform(self, X, y=None):

    return self.fit(X, y).transform(X, y)
