class_docstr: Base class for PCA methods.
  
  Warning: This class should not be used directly.
  Use derived classes instead.
docstr: Apply dimensionality reduction to X.
  
  X is projected on the first principal components previously extracted
  from a training set.
  
  Parameters
  ----------
  X : array-like, shape (n_samples, n_features)
      New 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)
  
  Examples
  --------
  
  >>> import numpy as np
  >>> from sklearn.decomposition import IncrementalPCA
  >>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
  >>> ipca = IncrementalPCA(n_components=2, batch_size=3)
  >>> ipca.fit(X)
  IncrementalPCA(batch_size=3, copy=True, n_components=2, whiten=False)
  >>> ipca.transform(X) # doctest: +SKIP
docstr_tok: ["Apply","dimensionality","reduction","to","X.","X","is","projected","on","the","first","principal","components","previously","extracted","from","a","training","set",".","Parameters","--","--","--","--","--","X",":","array-like",",","shape","(","n_samples",",","n_features",")","New","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",")","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","sklearn.decomposition","import","IncrementalPCA",">",">",">","X","=","np.array","(","[","[","-1",",","-1","]",",","[","-2",",","-1","]",",","[","-3",",","-2","]",",","[","1",",","1","]",",","[","2",",","1","]",",","[","3",",","2","]","]",")",">",">",">","ipca","=","IncrementalPCA","(","n_components=2",",","batch_size=3",")",">",">",">","ipca.fit","(","X",")","IncrementalPCA","(","batch_size=3",",","copy=True",",","n_components=2",",","whiten=False",")",">",">",">","ipca.transform","(","X",")","#","doctest",":","+SKIP"]
code: def transform(self, X, y=None):
      """Apply dimensionality reduction to X.
  
      X is projected on the first principal components previously extracted
      from a training set.
  
      Parameters
      ----------
      X : array-like, shape (n_samples, n_features)
          New 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)
  
      Examples
      --------
  
      >>> import numpy as np
      >>> from sklearn.decomposition import IncrementalPCA
      >>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
      >>> ipca = IncrementalPCA(n_components=2, batch_size=3)
      >>> ipca.fit(X)
      IncrementalPCA(batch_size=3, copy=True, n_components=2, whiten=False)
      >>> ipca.transform(X) # doctest: +SKIP
      """
      check_is_fitted(self, ["mean_", "components_"], all_or_any=all)
  
      X = check_array(X)
      if self.mean_ is not None:
          X = X - self.mean_
      X_transformed = fast_dot(X, self.components_.T)
      if self.whiten:
          X_transformed /= np.sqrt(self.explained_variance_)
      return X_transformed
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/decomposition/base.py
imports: import numpy
  from scipy import linalg
  from ..base import BaseEstimator, TransformerMixin
  from ..utils import check_array
  from ..utils.extmath import fast_dot
  from ..utils.validation import check_is_fitted
  from ..externals import six
  from abc import ABCMeta, abstractmethod
label_desc: Use image node_id 4 for calling the _BasePCA obj's underlying member method code with example usage: obj.transform(X, y) and returns: X_transformed