Table of Contents

Class FastICA<T>

Namespace
AiDotNet.Preprocessing.DimensionalityReduction
Assembly
AiDotNet.dll

Fast Independent Component Analysis (FastICA) for blind source separation.

public class FastICA<T> : TransformerBase<T, Matrix<T>, Matrix<T>>, IDataTransformer<T, Matrix<T>, Matrix<T>>

Type Parameters

T

The numeric type for calculations (e.g., float, double).

Inheritance
TransformerBase<T, Matrix<T>, Matrix<T>>
FastICA<T>
Implements
IDataTransformer<T, Matrix<T>, Matrix<T>>
Inherited Members

Remarks

FastICA separates a multivariate signal into additive, independent non-Gaussian components. It is commonly used for blind source separation (e.g., separating mixed audio signals) and feature extraction.

The algorithm: 1. Centers and whitens the data 2. Uses fixed-point iteration to find independent components 3. Each component is found by maximizing non-Gaussianity

For Beginners: Imagine you have recordings from multiple microphones in a room with multiple speakers. ICA can separate the individual speakers: - It finds components that are statistically independent - Unlike PCA which finds uncorrelated components, ICA finds truly independent ones - Works best when source signals are non-Gaussian (most real-world signals are)

Constructors

FastICA(int, ICAAlgorithm, ICAFunction, int, double, bool, int, int[]?)

Creates a new instance of FastICA<T>.

public FastICA(int nComponents = 2, ICAAlgorithm algorithm = ICAAlgorithm.Parallel, ICAFunction fun = ICAFunction.LogCosh, int maxIterations = 200, double tolerance = 0.0001, bool whiten = true, int randomState = 0, int[]? columnIndices = null)

Parameters

nComponents int

Number of components to extract. Defaults to 2.

algorithm ICAAlgorithm

Algorithm: parallel or deflation. Defaults to Parallel.

fun ICAFunction

Non-linearity function: logcosh, exp, or cube. Defaults to LogCosh.

maxIterations int

Maximum iterations. Defaults to 200.

tolerance double

Convergence tolerance. Defaults to 1e-4.

whiten bool

Whether to whiten data before ICA. Defaults to true.

randomState int

Random seed. Defaults to 0.

columnIndices int[]

The column indices to use, or null for all columns.

Properties

Algorithm

Gets the algorithm type (parallel or deflation).

public ICAAlgorithm Algorithm { get; }

Property Value

ICAAlgorithm

Components

Gets the unmixing matrix (components).

public double[,]? Components { get; }

Property Value

double[,]

Fun

Gets the non-linearity function used.

public ICAFunction Fun { get; }

Property Value

ICAFunction

Mixing

Gets the mixing matrix.

public double[,]? Mixing { get; }

Property Value

double[,]

NComponents

Gets the number of independent components.

public int NComponents { get; }

Property Value

int

SupportsInverseTransform

Gets whether this transformer supports inverse transformation.

public override bool SupportsInverseTransform { get; }

Property Value

bool

Methods

FitCore(Matrix<T>)

Fits FastICA to extract independent components.

protected override void FitCore(Matrix<T> data)

Parameters

data Matrix<T>

The training data matrix.

GetFeatureNamesOut(string[]?)

Gets the output feature names after transformation.

public override string[] GetFeatureNamesOut(string[]? inputFeatureNames = null)

Parameters

inputFeatureNames string[]

Returns

string[]

InverseTransformCore(Matrix<T>)

Transforms independent components back to original space.

protected override Matrix<T> InverseTransformCore(Matrix<T> data)

Parameters

data Matrix<T>

The independent components.

Returns

Matrix<T>

Reconstructed data in original space.

TransformCore(Matrix<T>)

Transforms the data to independent components.

protected override Matrix<T> TransformCore(Matrix<T> data)

Parameters

data Matrix<T>

The data to transform.

Returns

Matrix<T>

The independent components.