# Fit FactorAnalysis¶

Factor Analysis. A simple linear generative model with Gaussian latent variables. The observations are assumed to be caused by a linear transformation of lower dimensional latent factors and added Gaussian noise. Without loss of generality the factors are distributed according to a Gaussian with zero mean and unit covariance. The noise is also zero mean and has an arbitrary diagonal covariance matrix. If we would restrict the model further, by assuming that the Gaussian noise is even isotropic (all diagonal entries are the same) we would obtain ProbabilisticPCA. FactorAnalysis performs a maximum likelihood estimate of the so-called loading matrix, the transformation of the latent variables to the observed ones, using SVD based approach.

Parameters

Transformer [string]

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

Default:

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

factorAnalysis = FactorAnalysis(n_components=3)
transformer = make_pipeline(StandardScaler(), factorAnalysis)

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:FitFactoranalysis:

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

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

factorAnalysis = FactorAnalysis(n_components=3)
transformer = make_pipeline(StandardScaler(), factorAnalysis)
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