FactorAnalysis<T>

Models & Types · AiDotNet.Preprocessing.DimensionalityReduction

Factor Analysis for dimensionality reduction with noise modeling.

Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → FactorAnalysis<T>

For Beginners

Factor Analysis is like PCA but smarter about noise:

  • PCA assumes all variance is signal
  • Factor Analysis separates “common variance” (shared across features)

from “unique variance” (noise specific to each feature)

  • Use when your features have different noise levels
  • Popular in psychology, social sciences, and survey analysis

How It Works

Factor Analysis assumes that the observed data X is generated from a set of latent factors F plus feature-specific noise: X = F * W + noise. Unlike PCA, Factor Analysis explicitly models unique variance (noise) for each feature.

The model assumes:

  • X = W * F + ε
  • Where ε ~ N(0, Ψ) and Ψ is diagonal (unique variances)
  • F ~ N(0, I) are the latent factors

Constructors

Constructor Summary
FactorAnalysis(int nComponents, int maxIter, double tol, FactorRotation rotation, int? randomState, int[] columnIndices) Creates a new instance of FactorAnalysis.

Properties

Property Summary
FactorRotation Rotation { get; } Gets the rotation method.
Matrix<T> Components { get; } Gets the factor loadings (each column is a factor).
Vector<T> Mean { get; } Gets the mean of each feature.
Vector<T> NoiseVariance { get; } Gets the unique variance (noise) for each feature.
bool SupportsInverseTransform { get; } Gets whether this transformer supports inverse transformation.
int NComponents { get; } Gets the number of factors.

Methods

Method Summary
string[] GetFeatureNamesOut(string[] inputFeatureNames) Gets the output feature names after transformation.