FastIca Class

Implements Independent Component Analysis (ICA) using the FastICA algorithm.

Definition

Namespace: Numerics.NET.Statistics.Multivariate
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.1.5
C#
public sealed class FastIca : TransformationModel<double>
Inheritance
Object  →  Model  →  TransformationModel<Double>  →  FastIca

Remarks

Independent Component Analysis (ICA) is a computational method for separating a multivariate signal into additive subcomponents that are statistically independent and non-Gaussian. ICA is widely used in signal processing, data analysis, and machine learning for tasks such as blind source separation, feature extraction, and noise reduction.

This class provides an implementation of the FastICA algorithm, which is an efficient and popular method for performing ICA. FastICA can extract independent components from observed data by maximizing non-Gaussianity using fixed-point iteration. The algorithm supports both parallel (symmetric) and deflation (sequential) extraction modes.

Features of this implementation include:

  • Support for multiple contrast (nonlinearity) functions: LogCosh, Exponential, and Cubic.
  • Configurable number of components to extract.
  • Flexible whitening options: skip, arbitrary variance, and unit variance (matching scikit-learn semantics).
  • Sign correction to ensure consistent orientation of components.
  • Access to mixing and unmixing matrices, source estimates, whitening matrices, and convergence reports.
  • API compatibility with common ICA libraries and test suites.

Usage:

C#
var ica = new FastIca(dataFrame);
ica.NumberOfComponents = 3;
ica.ContrastFunction = FastIcaContrastFunction.LogCosh;
ica.Fit();
var sources = ica.Sources;
var mixing = ica.MixingMatrix;

References:

Constructors

FastIca(IDataFrame) Initializes a new instance of the IndependentComponentAnalysis class.
FastIca(Matrix<Double>) Initializes a new instance of the IndependentComponentAnalysis class.
FastIca(Vector<Double>[]) Initializes a new instance of the IndependentComponentAnalysis class.
FastIca(IDataFrame, String) Initializes a new instance of the IndependentComponentAnalysis class.
FastIca(IDataFrame, String[]) Initializes a new instance of the IndependentComponentAnalysis class.
FastIca(IEnumerable<Vector<Double>>, Vector<Double>) Initializes a new instance of the IndependentComponentAnalysis class.

Properties

ApplySignCorrection If true, apply sign correction to make the largest absolute value in each column of the mixing matrix positive. Default is true to match common implementations.
BaseFeatureIndex Gets an index containing the keys of the columns that are required inputs to the model.
(Inherited from Model)
Components Gets the estimated unmixing matrix (components_) with dimensions (nComponents × nFeatures).
Computed Gets whether the model has been computed.
(Inherited from Model)
Obsolete.
ContrastFunction Gets or sets the contrast (nonlinearity) function used in the FastICA fixed-point iteration.
Data Gets an object that contains all the data used as input to the model.
(Inherited from Model)
DewhiteningMatrix Gets the dewhitening matrix (inverse of the whitening matrix).
Features Gets a matrix that contains the features.
(Inherited from TransformationModel<T>)
FitStatus Gets the final fit status (converged or iteration limit exceeded).
Fitted Gets whether the model has been computed.
(Inherited from Model)
InitialUnmixingMatrix Gets or sets the initial unmixing matrix for warm-start initialization.
InputSchema Gets the schema for the features used for fitting the model.
(Inherited from Model)
IterationsNeeded Gets the number of iterations performed by the algorithm (n_iter_).
LogCoshAlpha Gets or sets the alpha parameter for the LogCosh contrast function.
MaxDegreeOfParallelism Gets or sets the maximum degree of parallelism enabled by this instance.
(Inherited from Model)
MaxIterations Gets or sets the maximum number of iterations for the FastICA algorithm.
Means Gets the feature-wise means computed from the training data.
Method Gets or sets the extraction method (parallel or deflation mode).
MixingMatrix Gets the estimated mixing matrix (M) with dimensions (nFeatures × nComponents).
ModelSchema Gets the collection of variables used in the model.
(Inherited from Model)
NumberOfComponents Gets or sets the number of independent components to extract.
NumberOfObservations Gets the number of observations the model is based on.
(Inherited from Model)
Random Gets or sets the random number generator used for initialization.
SolutionReport Gets the solution report containing convergence information.
Sources Gets the estimated source matrix (nSamples × nComponents) if computed during fitting.
Status Gets the status of the model, which determines which information is available.
(Inherited from Model)
SupportsWeights Indicates whether the model supports case weights.
(Inherited from Model)
Tolerance Gets or sets the convergence tolerance for the FastICA algorithm.
UnmixingMatrix Gets the unmixing matrix (W_full) whose rows are component weight vectors.
Weights Gets or sets the actual weights.
(Inherited from Model)
Whiten Gets or sets the whitening (pre-processing) mode.
WhiteningMatrix Gets the whitening matrix (K) used during preprocessing.

Methods

Compute() Computes the model.
(Inherited from Model)
Obsolete.
Compute(ParallelOptions) Computes the model.
(Inherited from Model)
Obsolete.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Fit() Fits the model to the data.
(Inherited from Model)
Fit(ParallelOptions) Fits the model to the data.
(Inherited from Model)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
InverseTransform(Matrix<Double>) Applies the inverse transformation to a set of observations.
(Inherited from TransformationModel<T>)
InverseTransform(Vector<Double>) Applies the inverse transformation to a set of observations.
(Inherited from TransformationModel<T>)
InverseTransformInto(Matrix<Double>, Matrix<Double>) Applies the inverse transformation to a matrix.
(Overrides TransformationModel<T>.InverseTransformInto(Matrix<Double>, Matrix<Double>))
InverseTransformInto(Vector<Double>, Vector<Double>) Applies the inverse transformation to a vector.
(Overrides TransformationModel<T>.InverseTransformInto(Vector<Double>, Vector<Double>))
ResetComputation Clears all fitted model parameters.
(Inherited from Model)
Obsolete.
ResetFit Clears all fitted model parameters.
(Inherited from Model)
SetDataSource Uses the specified data frame as the source for all input variables.
(Inherited from Model)
Summarize() Returns a string containing a human-readable summary of the object using default options.
(Inherited from Model)
Summarize(SummaryOptions) Returns a string containing a human-readable summary of the object using the specified options.
(Inherited from Model)
ToStringReturns a string that represents the current object.
(Inherited from Model)
Transform(Matrix<Double>) Applies the transformation to a set of observations.
(Inherited from TransformationModel<T>)
Transform(Vector<Double>) Applies the transformation to a single observation.
(Inherited from TransformationModel<T>)
TransformInto(Matrix<Double>, Matrix<Double>) Applies the transformation to a matrix.
(Overrides TransformationModel<T>.TransformInto(Matrix<Double>, Matrix<Double>))
TransformInto(Vector<Double>, Vector<Double>) Applies the transformation to a vector.
(Overrides TransformationModel<T>.TransformInto(Vector<Double>, Vector<Double>))

See Also