Fit PCA
Principal component analysis (PCA). Linear dimensionality reduction using Singular Value Decomposition of the data to project it to a lower dimensional space. The input data is centered but not scaled for each feature before applying the SVD.
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 PCA pca = PCA(n_components=0.95) transformer = make_pipeline(StandardScaler(), pca)
- 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:FitPca
:
----------------
Arguments
----------------
transformer: Transformer
Default value: from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
pca = PCA(n_components=0.95)
transformer = make_pipeline(StandardScaler(), pca)
Argument type: string
Acceptable values:
- String value
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
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