API Reference#
This page documents the stable public API of amica.
Most users will interact with one of two interfaces:
amica.Amicafor fitting AMICA directly on NumPy arrays.amica.fit_ica()for MNE-Python workflows.
Core API#
Classes#
Native JAX implementation of AMICA algorithm. |
|
Configuration for AMICA algorithm. |
|
Container for AMICA results. |
Functions#
Fit ICA using AMICA on MNE Raw or Epochs data. |
Low-level Solver#
- amica.amica(X, n_components=None, whiten=False, return_n_iter=False, random_state=None, max_iter=2000, num_mix=3, **kwargs)[source]#
Adaptive Mixture ICA (AMICA).
Returns the
(K, W, Y)tuple MNE-Python’s ICA dispatch expects (the calling convention shared by its fastica/infomax/picard methods), used in MNE-Python’sICAdispatch (method='amica').- Parameters:
- X
ndarray,shape(n_features,n_samples) Pre-whitened data, features x samples. This matches MNE’s ICA-method convention; MNE passes
data[:, sel].Twhich gives (n_components, n_samples).- n_components
intorNone Number of components. If None, uses X.shape[0].
- whitenbool
If True, whiten the data internally. MNE always passes False (data is pre-whitened by MNE’s PCA step).
- return_n_iterbool
If True, return n_iter as a fourth element:
K, W, Y, n_iter.- random_state
intorNone Random seed for reproducibility.
- max_iter
int Maximum number of EM iterations.
- num_mix
int Number of generalized Gaussian mixture components per source.
- **kwargs
Additional parameters passed to AmicaConfig.
- X
- Returns:
- K
None Pre-whitening matrix. Always None when
whiten=False. Included for the MNE ICA-method signature; MNE discards this value.- W
ndarray,shape(n_components,n_components) Unmixing matrix (operates on whitened data).
- Y
ndarray,shape(n_components,n_samples) Source matrix:
W @ X.- n_iter
int Number of iterations. Only returned when
return_n_iter=True, as the fourth element.
- K