Attention

bciflow.datasets.attention.attention(subject: int = 1, path: str = 'data/attention/', labels: List[str] = ['focused', 'unfocused', 'drowsy']) Dict[str, Any][source]

Description

This function loads EEG data for a specific subject and session from the attention dataset. It processes the data to fit the structure of the eegdata dictionary, which is used for further processing and analysis.

The dataset can be found at:
param subject:

index of the subject to retrieve the data from

type subject:

int

param path:

Path to the .mat file.

type path:

str

returns:
Dictionary with:

X: EEG data as [1, 1, channels, samples]. y: Labels per sample. sfreq: Sampling frequency. y_dict: Label mapping dictionary. events: Event segments dictionary. ch_names: Channel names. tmin: Start time (0.0). data_type: Type of the data (‘raw’).

rtype:

dict

Examples

Load EEG data for subject 1, all sessions, and default labels:

>>> from bciflow.datasets import attention
>>> eeg_data = attention(subject=1)
>>> print(eeg_data['X'].shape)  # Shape of the EEG data
>>> print(eeg_data['y'])  # Labels
'''