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 )
Configuration options for FastICA Number of components to extract. If not set, uses min(nSamples, nFeatures).
Maximum number of iterations for convergence.
Convergence tolerance for stopping criterion.
Seed for random number generator for reproducible results.
Methods
fit
Estimate independent components from training data.
Training data of shape [nSamples, nFeatures]
Returns: The fitted FastICA instance
transform ( X : Matrix ): Matrix
Extract independent sources from data.
Data to transform of shape [nSamples, nFeatures]
Returns: Independent sources of shape [nSamples, nComponents]
fitTransform ( X : Matrix ): Matrix
Fit the model and extract sources in one step.
Training data of shape [nSamples, nFeatures]
Returns: Independent sources of shape [nSamples, nComponents]
inverseTransform ( X : Matrix ): Matrix
Reconstruct original data from independent sources.
Independent sources of shape [nSamples, nComponents]
Returns: Reconstructed data of shape [nSamples, nFeatures]
Properties
Unmixing matrix, shape [nComponents, nComponents]
Mixing matrix, shape [nComponents, nComponents]
Per-feature mean of training data
Number of iterations run for convergence
Number of features seen during fit
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 );