class_docstr: Base class for random projections.
  
  Warning: This class should not be used directly.
  Use derived classes instead.
class_docstr_tok: ["Base","class","for","random","projections",".","Warning",":","This","class","should","not","be","used","directly",".","Use","derived","classes","instead","."]
docstr: 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.
  
  y : is not used: placeholder to allow for usage in a Pipeline.
  
  Returns
  -------
  X_new : numpy array or scipy sparse of shape [n_samples, n_components]
      Projected array.
docstr_tok: ["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",".","y",":","is","not","used",":","placeholder","to","allow","for","usage","in","a","Pipeline",".","Returns","--","--","--","-","X_new",":","numpy","array","or","scipy","sparse","of","shape","[","n_samples",",","n_components","]","Projected","array","."]
code: def transform(self, X, y=None):
      """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.
  
      y : is not used: placeholder to allow for usage in a Pipeline.
  
      Returns
      -------
      X_new : numpy array or scipy sparse of shape [n_samples, n_components]
          Projected array.
  
      """
      X = check_array(X, accept_sparse=["csr", "csc"])
  
      if self.components_ is None:
          raise NotFittedError(
              "No random projection matrix had been fit."
          )
  
      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
  
imports: from __future__ import division
  import warnings
  from abc import ABCMeta, abstractmethod
  import numpy
  from numpy.testing import assert_equal
  import scipy.sparse
  from .base import BaseEstimator, TransformerMixin
  from .externals import six
  from .externals.six.moves import xrange
  from .utils import check_random_state
  from .utils.extmath import safe_sparse_dot
  from .utils.random import sample_without_replacement
  from .utils.validation import check_array
  from .exceptions import DataDimensionalityWarning
  from .exceptions import NotFittedError
label_desc: Use image node_id 4 for calling the BaseRandomProjection obj's underlying member method code with example usage: obj.transform(X, y) and returns: X_new