cannot import name 'time_generalization' from 'mne.decoding'

When I tried

from mne.decoding import time_generalization

scores = time_generalization(epochs_list, clf=None, cv=5, scoring="roc_auc",
                             shuffle=True, n_jobs=4)

I got an error that said:

ImportError                               Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_40372/ in <module>
----> 1 from mne.decoding import time_generalization

ImportError: cannot import name 'time_generalization' from 'mne.decoding' (C:\Users\Rekha\Anaconda3\envs\mne\lib\site-packages\mne\decoding\

What could be the issue? Is this not a python function? If not, what is its equivalent?

What made you believe there’s a time_generalization function in MNE? There is nothing with that name.

You’ll want to use the GeneralizingEstimator, as described in this tutorial:

1 Like