obob_mne.decoding.Temporal¶
-
class
obob_mne.decoding.Temporal(epochs, pipeline, epochs_test=None, cv=2, scoring='accuracy', n_jobs=-1)[source]¶ Apply a decoding pipeline to every sample.
Use this class to perform Temporal decoding. This means that a classifier is trained on every sample and tested on that very sample.
The minimum requirements are the data as
mne.Epochsand the pipeline assklearn.pipeline.Pipeline, which is most commonly generated usingsklearn.pipeline.make_pipeline().This class treats every individual
event_idas an individual target. If you want to combine multipleevents_idinto one target, you can useepochs.collapse_conditions().If you want the training and testing data to be different, you can supply the training data to
epochsand the testing data toepochs_test.Cross validation will be run only if training and testing data are equal (i.e., when
epochs_test=None).Parameters: - epochs (
mne.Epochs) – The epochs to apply the classifier pipeline to. - pipeline (
sklearn.pipeline.Pipeline) – The classifier pipeline to use. Most likely created withsklearn.pipeline.make_pipeline() - epochs_test (
mne.Epochsor None, optional) – If set, the classifier gets tested on this data. The event_ids must be equal. No crossvalidation will be run in this case. - cv (int, optional) – The amount of folds for cross validation
- scoring (str or callable, optional) – The scoring function to use.
- n_jobs (int, optional) – Number of CPU cores to use
Methods
__init__(epochs, pipeline[, epochs_test, …])add_channels(add_list[, force_update_info])Append new channels to the instance. add_proj(projs[, remove_existing, verbose])Add SSP projection vectors. animate_topomap([ch_type, times, …])Make animation of evoked data as topomap timeseries. anonymize()Anonymize measurement information in place. apply_baseline([baseline, verbose])Baseline correct evoked data. apply_proj()Apply the signal space projection (SSP) operators to the data. as_type([ch_type, mode])Compute virtual evoked using interpolated fields. copy()Copy the instance of evoked. crop([tmin, tmax])Crop data to a given time interval. decimate(decim[, offset])Decimate the evoked data. del_proj([idx])Remove SSP projection vector. detrend([order, picks])Detrend data. drop_channels(ch_names)Drop some channels. filter(l_freq, h_freq[, picks, …])Filter a subset of channels. get_peak([ch_type, tmin, tmax, mode, …])Get location and latency of peak amplitude. interpolate_bads([reset_bads, mode, verbose])Interpolate bad MEG and EEG channels. pick_channels(ch_names)Pick some channels. pick_types([meg, eeg, stim, eog, ecg, emg, …])Pick some channels by type and names. plot([picks, exclude, unit, show, ylim, …])Plot evoked data using butterfly plots. plot_field(surf_maps[, time, time_label, n_jobs])Plot MEG/EEG fields on head surface and helmet in 3D. plot_image([picks, exclude, unit, show, …])Plot evoked data as images. plot_joint([times, title, picks, exclude, …])Plot evoked data as butterfly plot and add topomaps for time points. plot_projs_topomap([ch_type, layout, axes])Plot SSP vector. plot_scores([axes, show])Plot the scores as a line plot. plot_sensors([kind, ch_type, title, …])Plot sensor positions. plot_topo([layout, layout_scale, color, …])Plot 2D topography of evoked responses. plot_topomap([times, ch_type, layout, vmin, …])Plot topographic maps of specific time points of evoked data. plot_white(noise_cov[, show, rank, …])Plot whitened evoked response. rename_channels(mapping)Rename channels. reorder_channels(ch_names)Reorder channels. resample(sfreq[, npad, window, n_jobs, pad, …])Resample data. save(fname)Save dataset to file. savgol_filter(h_freq[, verbose])Filter the data using Savitzky-Golay polynomial method. set_channel_types(mapping)Define the sensor type of channels. set_eeg_reference([ref_channels, …])Specify which reference to use for EEG data. set_montage(montage[, set_dig, verbose])Set EEG sensor configuration and head digitization. shift_time(tshift[, relative])Shift time scale in evoked data. time_as_index(times[, use_rounding])Convert time to indices. to_data_frame([picks, index, scaling_time, …])Export data in tabular structure as a pandas DataFrame. Attributes
ch_namesChannel names. chance_levelfloat – The chance level of the classifier. compensation_gradeThe current gradient compensation grade. dataThe data matrix. decoderThe decoder. naveint – Number of epochs in the training set. nave_testingint – Number of epochs in the testing set. nclassesprojWhether or not projections are active. scoresnumpy.ndarray– The scores of the classification- epochs (