mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.7k stars 1.31k forks source link

Q: Using plot_decoding_csp_eeg.py with .edf data recorded from OpenViBE #6626

Closed max-drake closed 5 years ago

max-drake commented 5 years ago

Hello! Apologies if this is covered somewhere else, but I haven't been able to find a solution online. I've done what I thought makes sense, but my classifier accuracy still hovers around 50%, so I wonder if my code is incorrect, or I just need more training data

Essentially, I want to train a classifier to differentiate left and right hand motor imagery using "plot_decoding_csp_eeg.py" as a template. I recorded .edf data from an OpenBCI headset using the Graz motor imagery scenario that comes with OpenViBE (I don't want to use OpenViBE's classifier).

Basically what I've changed is as follows: #raw_fnames = eegbci.load_data(subject, runs) #raw = concatenate_raws([read_raw_edf(f, preload=True) for f in raw_fnames]) fname = data/EDFTESTfilterandepoching.edf raw = concatenate_raws([read_raw_edf(fname, preload=True)]) as well as: event_id = {OVTK_GDF_Left:4, OVTK_GDF_Right:5} events, _ = events_from_annotations(raw, event_id = event_id) Where OVTK_GDF_Left and OVTK_GDF_Right are the native names of the stimulations

The only other things I've changed are the tmin and tmax values passed into the Epochs class, as well as in 'epochs.copy().crop(tmin,tmax)' Here's a screenshot of my classification

agramfort commented 5 years ago

it's hard to tell without look at the data and testing ourself. Please avoid using the issue tracker for usage question. Use gitter or the regular mailing list.