(
    subject,
    path=None,
    force_update=False,
    update_path=None,
    base_url=BNCI_URL,
    verbose=None,
)
return sessions
Load data for 004-2015 dataset.
Load data for 004-2015 dataset.
Load data for 004 - 2015 dataset .
def _load_data_004_2015(
    subject,
    path=None,
    force_update=False,
    update_path=None,
    base_url=BNCI_URL,
    verbose=None,
):
    """Load data for 004-2015 dataset."""
    if (subject < 1) or (subject > 9):
        raise ValueError("Subject must be between 1 and 9. Got %d." % subject)

    subjects = ["A", "C", "D", "E", "F", "G", "H", "J", "L"]

    url = "{u}004-2015/{s}.mat".format(u=base_url, s=subjects[subject - 1])
    filename = data_path(url, path, force_update, update_path)[0]

    # fmt: off
    ch_names = [
        "AFz", "F7", "F3", "Fz", "F4", "F8", "FC3", "FCz", "FC4", "T3", "C3",
        "Cz", "C4", "T4", "CP3", "CPz", "CP4", "P7", "P5", "P3", "P1", "Pz",
        "P2", "P4", "P6", "P8", "PO3", "PO4", "O1", "O2",
    ]
    # fmt: on
    ch_types = ["eeg"] * 30
    raws, ev = _convert_mi(filename, ch_names, ch_types)
    sessions = {"session_%d" % ii: {"run_0": run} for ii, run in enumerate(raws)}
    return sessions
def _load_data_004_2015 ( subject , path = None , force_update = False , update_path = None , base_url = BNCI_URL , verbose = None , ) : if ( subject < 1 ) or ( subject > 9 ) : raise ValueError ( "Subject must be between 1 and 9. Got %d." % subject ) subjects = [ "A" , "C" , "D" , "E" , "F" , "G" , "H" , "J" , "L" ] url = "{u}004-2015/{s}.mat" . format ( u = base_url , s = subjects [ subject - 1 ] ) filename = data_path ( url , path , force_update , update_path ) [ 0 ] # fmt: off ch_names = [ "AFz" , "F7" , "F3" , "Fz" , "F4" , "F8" , "FC3" , "FCz" , "FC4" , "T3" , "C3" , "Cz" , "C4" , "T4" , "CP3" , "CPz" , "CP4" , "P7" , "P5" , "P3" , "P1" , "Pz" , "P2" , "P4" , "P6" , "P8" , "PO3" , "PO4" , "O1" , "O2" , ] # fmt: on ch_types = [ "eeg" ] * 30 raws , ev = _convert_mi ( filename , ch_names , ch_types ) sessions = { "session_%d" % ii : { "run_0" : run } for ii , run in enumerate ( raws ) } return sessions