'Fit the model with X and apply the dimensionality reduction on X.
Parameters
X : array-like, shape (n_samples, n_features)
Training data, where n_samples is the number of samples
and n_features is the number of features.
Returns
X_new : array-like, shape (n_samples, n_components)'

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

    (U, S, V) = self._fit(X)
    U = U[:, :self.n_components_]
    if self.whiten:
        U *= sqrt((X.shape[0] - 1))
    else:
        U *= S[:self.n_components_]
    return U
