

def transform(self, X, y=None):
    'Apply dimensionality reduction to X.\n\n        X is projected on the first principal components previously extracted\n        from a training set.\n\n        Parameters\n        ----------\n        X : array-like, shape (n_samples, n_features)\n            New data, where n_samples is the number of samples\n            and n_features is the number of features.\n\n        Returns\n        -------\n        X_new : array-like, shape (n_samples, n_components)\n\n        Examples\n        --------\n\n        >>> import numpy as np\n        >>> from sklearn.decomposition import IncrementalPCA\n        >>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])\n        >>> ipca = IncrementalPCA(n_components=2, batch_size=3)\n        >>> ipca.fit(X)\n        IncrementalPCA(batch_size=3, copy=True, n_components=2, whiten=False)\n        >>> ipca.transform(X) # doctest: +SKIP\n        '
    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

dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/decomposition/base.py _BasePCA.transform/original