Iām encountering a warning when attempting to fit my ica to my raw data. I have a 10-minute EEG recording consisting of 46 channels with sampling rate 250 Hz.
Iāve tried to use the syntax given under the API reference for ICA.
import mne
from mne.preprocessing import ICA
raw = mne.io.read_raw_edf('myfile.edf',preload=True)
raw_filt = raw.filter(l_freq=1, h_freq=None)
ica = ICA(method='fastica',n_components=.999999, random_state=6,max_iter="auto")
ica.fit(raw_filt)
In the fitting step, I receive the following warning:
> RuntimeWarning: Using n_components=0.999999 (resulting in n_components_=6) may lead to an unstable mixing matrix estimation because the ratio between the largest (46) and smallest (2.2e-05) variances is too large (> 1e6); consider setting n_components=0.999999 or an integer <= 5
Iām not sure how to address this, particularly since Iāve followed the suggestion and set n_components=.999999 . I observed that setting n_components=5 did not produce a warning, but Iām not sure why.
Also, do I apply the fit to the original raw data or the filtered version?
thank you for your attention. I am using EEG data, 64 channels, recorded using BioSemi. I have a total of 30 participants and this ICA issue seems to happen only on particular datasets. I am now inspecting the data to see if perhaps the dataset itself is corrupted but it does not look like it.
Unfortunately, I am not able to share either the dataset or the code due to IP agreements. However, after careful inspection, I can conclude that the behaviour was very likely due to the low signal-to-noise ratio. After rejecting manually segments of the data that seemed problematic, the ICA issue seems to stop. I will keep you updated should this happen again.