mne.decoding.compute_ems#
- mne.decoding.compute_ems(epochs, conditions=None, picks=None, n_jobs=None, cv=None, *, verbose=None)[source]#
Compute event-matched spatial filter on epochs.
This version of EMS [1] operates on the entire time course. No time window needs to be specified. The result is a spatial filter at each time point and a corresponding time course. Intuitively, the result gives the similarity between the filter at each time point and the data vector (sensors) at that time point.
Note
EMS only works for binary classification.
Note
The present function applies a leave-one-out cross-validation, following Schurger et al’s paper. However, we recommend using a stratified k-fold cross-validation. Indeed, leave-one-out tends to overfit and cannot be used to estimate the variance of the prediction within a given fold.
Note
Because of the leave-one-out, this function needs an equal number of epochs in each of the two conditions.
- Parameters:
- epochsinstance of
mne.Epochs The epochs.
- conditions
listofstr|None If a list of strings, strings must match the epochs.event_id’s key as well as the number of conditions supported by the objective_function. If None keys in epochs.event_id are used.
- picks
str| array_like |slice|None Channels to include. Slices and lists of integers will be interpreted as channel indices. In lists, channel type strings (e.g.,
['meg', 'eeg']) will pick channels of those types, channel name strings (e.g.,['MEG0111', 'MEG2623']will pick the given channels. Can also be the string values'all'to pick all channels, or'data'to pick data channels. None (default) will pick good data channels. Note that channels ininfo['bads']will be included if their names or indices are explicitly provided.- n_jobs
int|None The number of jobs to run in parallel. If
-1, it is set to the number of CPU cores. Requires thejoblibpackage.None(default) is a marker for ‘unset’ that will be interpreted asn_jobs=1(sequential execution) unless the call is performed under ajoblib.parallel_configcontext manager that sets another value forn_jobs.- cvcross-validation object |
str|None The cross-validation scheme. If None,
sklearn.model_selection.LeaveOneOutis used.- verbosebool |
str|int|None Control verbosity of the logging output. If
None, use the default verbosity level. See the logging documentation andmne.verbose()for details. Should only be passed as a keyword argument.
- epochsinstance of
- Returns:
References