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

    if subject in [8, 9, 10, 11]:
        ses = ["A", "B", "C"]  # 3 sessions for those subjects
    else:
        ses = ["A", "B"]

    # fmt: off
    ch_names = [
        "FC3", "FCz", "FC4", "C5", "C3", "C1", "Cz",
        "C2", "C4", "C6", "CP3", "CPz", "CP4",
    ]
    # fmt: on
    ch_types = ["eeg"] * 13

    sessions = {}
    for r in ses:
        url = "{u}001-2015/S{s:02d}{r}.mat".format(u=base_url, s=subject, r=r)
        filename = data_path(url, path, force_update, update_path)
        runs, ev = _convert_mi(filename[0], ch_names, ch_types)
        sessions["session_%s" % r] = {"run_%d" % ii: run for ii, run in enumerate(runs)}
    return sessions
def _load_data_001_2015 ( subject , path = None , force_update = False , update_path = None , base_url = BNCI_URL , verbose = None , ) : if ( subject < 1 ) or ( subject > 12 ) : raise ValueError ( "Subject must be between 1 and 12. Got %d." % subject ) if subject in [ 8 , 9 , 10 , 11 ] : ses = [ "A" , "B" , "C" ] # 3 sessions for those subjects else : ses = [ "A" , "B" ] # fmt: off ch_names = [ "FC3" , "FCz" , "FC4" , "C5" , "C3" , "C1" , "Cz" , "C2" , "C4" , "C6" , "CP3" , "CPz" , "CP4" , ] # fmt: on ch_types = [ "eeg" ] * 13 sessions = { } for r in ses : url = "{u}001-2015/S{s:02d}{r}.mat" . format ( u = base_url , s = subject , r = r ) filename = data_path ( url , path , force_update , update_path ) runs , ev = _convert_mi ( filename [ 0 ] , ch_names , ch_types ) sessions [ "session_%s" % r ] = { "run_%d" % ii : run for ii , run in enumerate ( runs ) } return sessions