Skip to main content

Overview

FastICA separates multivariate signals into independent non-Gaussian components. It uses a fixed-point iteration algorithm to find maximally independent sources.

Constructor

new FastICA(options?: FastICAOptions)
options
FastICAOptions
Configuration options for FastICA

Methods

fit

fit(X: Matrix): this
Estimate independent components from training data.
X
Matrix
required
Training data of shape [nSamples, nFeatures]
Returns: The fitted FastICA instance

transform

transform(X: Matrix): Matrix
Extract independent sources from data.
X
Matrix
required
Data to transform of shape [nSamples, nFeatures]
Returns: Independent sources of shape [nSamples, nComponents]

fitTransform

fitTransform(X: Matrix): Matrix
Fit the model and extract sources in one step.
X
Matrix
required
Training data of shape [nSamples, nFeatures]
Returns: Independent sources of shape [nSamples, nComponents]

inverseTransform

inverseTransform(X: Matrix): Matrix
Reconstruct original data from independent sources.
X
Matrix
required
Independent sources of shape [nSamples, nComponents]
Returns: Reconstructed data of shape [nSamples, nFeatures]

Properties

components_
Matrix | null
Unmixing matrix, shape [nComponents, nComponents]
mixing_
Matrix | null
Mixing matrix, shape [nComponents, nComponents]
mean_
Vector | null
Per-feature mean of training data
nIter_
number | null
Number of iterations run for convergence
nFeaturesIn_
number | null
Number of features seen during fit
nComponents_
number | null
Number of components extracted

Example

import { FastICA } from '@elucidate/elucidate';

// Mixed signal data (e.g., audio sources)
const mixedSignals = [
  [0.5, 0.8, 0.3],
  [1.2, 1.5, 1.0],
  [0.9, 0.6, 0.7],
  [1.5, 1.8, 1.2],
  [0.3, 0.4, 0.2],
];

const ica = new FastICA({ 
  nComponents: 2,
  randomState: 42 
});

const sources = ica.fitTransform(mixedSignals);
console.log('Independent sources:', sources);
console.log('Mixing matrix:', ica.mixing_);
console.log('Converged in', ica.nIter_, 'iterations');

// Reconstruct mixed signals
const reconstructed = ica.inverseTransform(sources);
console.log('Reconstructed:', reconstructed);

Build docs developers (and LLMs) love