'Project the data by using matrix product with the random matrix
Parameters
X : numpy array or scipy.sparse of shape [n_samples, n_features]
The input data to project into a smaller dimensional space.
Returns
X_new : numpy array or scipy sparse of shape [n_samples, n_components]
Projected array.'

def transform(self, X):

    X = check_array(X, accept_sparse=['csr', 'csc'])
    check_is_fitted(self, 'components_')
    if (X.shape[1] != self.components_.shape[1]):
        raise ValueError(('Impossible    to    perform    projection:X    at    fit    stage    had    a    different    number    of    features.    (%s    !=    %s)' % (X.shape[1], self.components_.shape[1])))
    X_new = safe_sparse_dot(X, self.components_.T, dense_output=self.dense_output)
    return X_new
