Skip to content

Commit d80b0c7

Browse files
DOC Fix KernelPCA docstrings for transform functions to match PCA class docstrings. (scikit-learn#31823)
1 parent 0ca4ac2 commit d80b0c7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

sklearn/decomposition/_kernel_pca.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ def fit_transform(self, X, y=None, **params):
471471
Returns
472472
-------
473473
X_new : ndarray of shape (n_samples, n_components)
474-
Returns the instance itself.
474+
Transformed values.
475475
"""
476476
self.fit(X, **params)
477477

@@ -495,7 +495,8 @@ def transform(self, X):
495495
Returns
496496
-------
497497
X_new : ndarray of shape (n_samples, n_components)
498-
Returns the instance itself.
498+
Projection of X in the first principal components, where `n_samples`
499+
is the number of samples and `n_components` is the number of the components.
499500
"""
500501
check_is_fitted(self)
501502
X = validate_data(self, X, accept_sparse="csr", reset=False)
@@ -545,7 +546,8 @@ def inverse_transform(self, X):
545546
Returns
546547
-------
547548
X_original : ndarray of shape (n_samples, n_features)
548-
Returns the instance itself.
549+
Original data, where `n_samples` is the number of samples
550+
and `n_features` is the number of features.
549551
550552
References
551553
----------

0 commit comments

Comments
 (0)