runamica#
- runamica(data, num_models=1, max_iter=2000, num_mix_comps=3, pcakeep=None, outdir=None, amica_binary=None, max_threads=4, cleanup=True, **kwargs)#
Run AMICA binary on a data matrix.
Parameters#
- datandarray, shape (chans, frames)
Input data matrix (float64).
- num_modelsint
Number of ICA models to fit.
- max_iterint
Maximum number of training iterations.
- num_mix_compsint
Number of mixture components per source.
- pcakeepint or None
Number of principal components to retain. Default: chans.
- outdirstr or None
Output directory. If None, a temporary directory is created.
- amica_binarystr or None
Path to AMICA binary. If None, auto-detected.
- max_threadsint
Maximum number of threads for the binary.
- cleanupbool
If True, remove temporary files after loading results.
- **kwargs
Additional AMICA parameters written to the param file as-is.
Returns#
- weightsndarray, shape (num_pcs, num_pcs)
Unmixing weights for model 0 (post-sphering).
- spherendarray, shape (num_pcs, chans)
Sphering matrix.
- modsdict
Full model output with keys: W, S, A, mean, gm, c, alpha, mu, sbeta, rho, LL, LLt, nd, comp_list, svar, origord, mod_prob, num_pcs, etc.