class sklearn.decomposition.KernelPCA(n_components=None, kernel=’linear’, gamma=None, degree=3, coef0=1, kernel_params=None, alpha=1.0, fit_inverse_transform=False, eigen_solver=’auto’, tol=0, max_iter=None, remove_zero_eig=False, random_state=None, copy_X=True, n_jobs=None)
[source]
Kernel Principal component analysis (KPCA)
Non-linear dimensionality reduction through the use of kernels (see Pairwise metrics, Affinities and Kernels).
Read more in the User Guide.
Parameters: |
|
---|---|
Attributes: |
|
>>> from sklearn.datasets import load_digits >>> from sklearn.decomposition import KernelPCA >>> X, _ = load_digits(return_X_y=True) >>> transformer = KernelPCA(n_components=7, kernel='linear') >>> X_transformed = transformer.fit_transform(X) >>> X_transformed.shape (1797, 7)
fit (X[, y]) | Fit the model from data in X. |
fit_transform (X[, y]) | Fit the model from data in X and transform X. |
get_params ([deep]) | Get parameters for this estimator. |
inverse_transform (X) | Transform X back to original space. |
set_params (**params) | Set the parameters of this estimator. |
transform (X) | Transform X. |
__init__(n_components=None, kernel=’linear’, gamma=None, degree=3, coef0=1, kernel_params=None, alpha=1.0, fit_inverse_transform=False, eigen_solver=’auto’, tol=0, max_iter=None, remove_zero_eig=False, random_state=None, copy_X=True, n_jobs=None)
[source]
fit(X, y=None)
[source]
Fit the model from data in X.
Parameters: |
|
---|---|
Returns: |
|
fit_transform(X, y=None, **params)
[source]
Fit the model from data in X and transform X.
Parameters: |
|
---|---|
Returns: |
|
get_params(deep=True)
[source]
Get parameters for this estimator.
Parameters: |
|
---|---|
Returns: |
|
inverse_transform(X)
[source]
Transform X back to original space.
Parameters: |
|
---|---|
Returns: |
|
“Learning to Find Pre-Images”, G BakIr et al, 2004.
set_params(**params)
[source]
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter>
so that it’s possible to update each component of a nested object.
Returns: |
|
---|
transform(X)
[source]
Transform X.
Parameters: |
|
---|---|
Returns: |
|
sklearn.decomposition.KernelPCA
© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.KernelPCA.html