'Perform dimensionality reduction on X.
Parameters
X : {array-like, sparse matrix}, shape (n_samples, n_features)
New data.
Returns
X_new : array, shape (n_samples, n_components)
Reduced version of X. This will always be a dense array.'

def transform(self, X):

    X = check_array(X, accept_sparse='csr')
    return safe_sparse_dot(X, self.components_.T)
