How can I extract labels from the raw .bdf file (DEAP dataset)?

Hi all,

I am a new bee in this area. Please guide me how can i extract labels from the raw .bdf file for the classification of DEAP dataset.

Thankyou.

I don’t have access to the DEAP dataset, but generally, annotations of BDF files should be stored in raw.annotations when reading the files via MNE-Python.

I don’t know this dataset either, but usually BDF files do not have annotations. Instead, there should be an analog trigger (stimulation) channel which you can use to create annotations and/or events: Parsing events from raw data — MNE 0.22.0 documentation

The docs for read_raw_bdf() state:

[…] TAL channels are parsed and extracted annotations are stored in raw.annotations. Use mne.events_from_annotations() to obtain events from these annotations.

I thought this might be a common thing, but also I’ve never worked with BDF data myself :slight_smile:

In general, BDF is just EDF, so annotations are possible. However, I’ve never seen them in the wild because BioSemi’s recording app just writes an analog stim channel and doesn’t support discrete annotations AFAIK.

1 Like

Hi all,

Thank you for your response.
As I checked, there is no annotations in my .bdf file also there is only 1 STIM channel i.e. status, rest all are of constant magnitude. So, is there any other way to extract labels from .bdf file format.
Another thing which I am not clear is whether event id can be used as a labels for classification.
I am sorry if my question is trivial, I am new in this.

Thank you

Hello,

you first need to extract the events.

For an introduction to classification using MNE, see the respective tutorial at
https://mne.tools/stable/auto_tutorials/machine-learning/plot_sensors_decoding.html

2 posts were split to a new topic: Creating epochs from continuous data without any events