# cannot import name 'time\_generalization' from 'mne.decoding'

**URL:** <https://mne.discourse.group/t/cannot-import-name-time-generalization-from-mne-decoding/4766>\
**Category:** Support & Discussions\
**Tags:** machine-learning\
**Created:** [April 22, 2022, 9:38pm UTC](https://mne.discourse.group/t/cannot-import-name-time-generalization-from-mne-decoding/4766 "2022-04-22T21:38:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rekha](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/rekha/32/1372_2.png) [@Rekha](https://mne.discourse.group/u/Rekha)\
**Post date:** [April 22, 2022, 9:38pm UTC](https://mne.discourse.group/t/cannot-import-name-time-generalization-from-mne-decoding/4766/1 "2022-04-22T21:38:40Z")

</div>

When I tried

```python
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:

```python
--------------------------------------------------------------------------
ImportError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_40372/2330388309.py 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\ __init__.py)

```

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

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [April 23, 2022, 7:01am UTC](https://mne.discourse.group/t/cannot-import-name-time-generalization-from-mne-decoding/4766/2 "2022-04-23T07:01:53Z")

</div>

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:

[https://mne.tools/stable/auto\_tutorials/machine-learning/50\_decoding.html#temporal-generalization](https://mne.tools/stable/auto_tutorials/machine-learning/50_decoding.html#temporal-generalization)
