ica_processing.fit_ica#
- autoclean.functions.ica.ica_processing.fit_ica(raw, n_components=None, method='fastica', max_iter='auto', random_state=97, picks=None, verbose=None, **kwargs)[source]#
Fit Independent Component Analysis (ICA) to EEG data.
This function creates and fits an ICA decomposition on the provided EEG data. ICA is commonly used to identify and remove artifacts like eye movements, muscle activity, and heartbeat from EEG recordings.
- Parameters:
- raw
mne.io.Raw
The raw EEG data to decompose with ICA.
- n_components
int
orNone
,default
None
Number of principal components to use. If None, uses all available components based on the data rank.
- method
str
,default
“fastica” The ICA algorithm to use. Options: “fastica”, “infomax”, “picard”.
- max_iter
int
or “auto”,default
“auto” Maximum number of iterations for the ICA algorithm.
- random_state
int
orNone
,default
97 Random state for reproducible results.
- picks
list
ofstr
,str
,or
None
,default
None
Channels to include in ICA. If None, uses all available channels.
- verbosebool or
None
,default
None
Control verbosity of output.
- **kwargs
Additional keyword arguments passed to mne.preprocessing.ICA.
- raw
- Returns:
- ica
mne.preprocessing.ICA
The fitted ICA object containing the decomposition.
- ica
See also
classify_ica_components
Classify ICA components using ICLabel
apply_ica_rejection
Apply ICA to remove artifact components
mne.preprocessing.ICA
MNE ICA implementation
Examples
>>> ica = fit_ica(raw) >>> ica = fit_ica(raw, n_components=20, method="picard")