Fit KernelPCA

Kernel Principal component analysis (KPCA). Non-linear dimensionality reduction through the use of kernels

Kernel PCA is an extension of Principal Component Analysis that allows for non-linear dimensionality reduction. It implicitly maps data into a higher-dimensional space where it becomes linearly separable, performs standard PCA in that space, and then projects the results back into the original feature space.

Usage:

  1. Start the algorithm from the Processing Toolbox panel.

  2. Select a raster layer to process and click run.

    ../../../../_images/KPCA.png

Parameters

Transformer [string]

Scikit-learn python code. See PCA for information on different parameters.

Default:

from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import KernelPCA

kernelPCA = KernelPCA(n_components=3, fit_inverse_transform=True)
transformer = make_pipeline(StandardScaler(), kernelPCA)
Raster layer with features [raster]

Raster layer with feature data X used for fitting the transformer. Mutually exclusive with parameter: Training dataset

Sample size [number]

Approximate number of samples drawn from raster. If 0, whole raster will be used. Note that this is only a hint for limiting the number of rows and columns.

Default: 1000

Training dataset [file]

Training dataset pickle file used for fitting the transformer. Mutually exclusive with parameter: Raster layer with features

Outputs

Output transformer [fileDestination]

Pickle file destination.

Command-line usage

>qgis_process help enmapbox:FitKernelpca:

----------------
Arguments
----------------

transformer: Transformer
    Default value:  from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import KernelPCA

kernelPCA = KernelPCA(n_components=3, fit_inverse_transform=True)
transformer = make_pipeline(StandardScaler(), kernelPCA)
    Argument type:  string
    Acceptable values:
            - String value
            - field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
            - expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
featureRaster: Raster layer with features (optional)
    Argument type:  raster
    Acceptable values:
            - Path to a raster layer
sampleSize: Sample size (optional)
    Default value:  1000
    Argument type:  number
    Acceptable values:
            - A numeric value
            - field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
            - expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
dataset: Training dataset (optional)
    Argument type:  file
    Acceptable values:
            - Path to a file
outputTransformer: Output transformer
    Argument type:  fileDestination
    Acceptable values:
            - Path for new file

----------------
Outputs
----------------

outputTransformer: <outputFile>
    Output transformer