Пример #1
0
             delta=(0.1, 3),
             theta=(3.5, 7.5),
             alpha=(7.5, 13),
             lower=(0.1, 7.5))

n_jobs = 48

# %%
for name in [
        'MEG_S01', 'MEG_S02', 'MEG_S03', 'MEG_S04', 'MEG_S05', 'MEG_S06',
        'MEG_S07', 'MEG_S08', 'MEG_S09', 'MEG_S10'
]:
    # Load MEG data
    # name = 'MEG_S02'
    dm = DataManager(name)
    dm.load_epochs(recompute=False)

    # Init cross validation
    cv = CV_split(dm)
    cv.reset()

    # MVPA parameters
    n_components = 6

    # Cross validation
    # y_pred and y_true will be stored in [labels]
    labels = []

    while cv.is_valid():
        # Recursive
        # Get current split
Пример #2
0
             delta=(0.1, 3),
             theta=(3.5, 7.5),
             alpha=(7.5, 13),
             lower=(0.1, 7.5))

n_jobs = 48

# %%
for subject in [
        'S01', 'S02', 'S03', 'S04', 'S05', 'S06', 'S07', 'S08', 'S09', 'S10'
]:
    name_eeg = f'EEG_{subject}'
    name_meg = f'MEG_{subject}'
    # Load data
    dm_eeg = DataManager(name_eeg)
    dm_eeg.load_epochs(recompute=False)
    dm_meg = DataManager(name_meg)
    dm_meg.load_epochs(recompute=False)

    # Init cross validation
    cv_eeg = CV_split(dm_eeg)
    cv_eeg.reset()
    cv_meg = CV_split(dm_meg)
    cv_meg.reset()

    # MVPA parameters
    n_components = 6

    # Cross validation
    # y_pred and y_true will be stored in [labels]
    labels = []
Пример #3
0
def run_subject(name):
    loader = DataManager(name, parameters=parameters_meg)
    loader.load_epochs(recompute=True)
    print(f'Done {name}.')
Пример #4
0
name = 'MEG_S02'

parameters_meg = dict(
    picks='mag',
    stim_channel='UPPT001',
    l_freq=0.1,
    h_freq=20,  # 7,
    tmin=-0.2,
    tmax=1.2,
    decim=12,
    detrend=1,
    reject=dict(mag=4e-12, ),
    baseline=None)

dm = DataManager(name, parameters=parameters_meg)
dm.load_epochs(recompute=True)

# %%
epochs_1, epochs_2 = dm.leave_one_session_out(includes=[1, 3, 5],
                                              excludes=[2, 4, 6])


def relabel(_epochs):
    # Relabel _epochs events from 4 to 2
    _epochs.events[_epochs.events[:, -1] == 4, -1] = 2
    # Remove 4 in event_id pool
    _epochs.event_id.pop('4')


relabel(epochs_1)
relabel(epochs_2)