n_jobs=-1) for subject in subjects: report = OnlineReport() # target ------------------------------------------------------------------ epochs, events = load(subject, 'Target') # Decode angles ----------------------------------------------------------- gat = gat_angle angles = np.array(events['left_angle'].as_matrix(), float) gat.fit(epochs, y=angles) gat.score(epochs, y=angles) fig, ax = plt.subplots(1) gat.plot(ax=ax, show=True) report.add_figs_to_section(fig, 'left_SVR', subject + 'Target') print('left_SVR', 'Target') gat = gat_angle angles = np.array(events['right_angle'].as_matrix(), float) gat.fit(epochs, y=angles) gat.score(epochs, y=angles) fig, ax = plt.subplots(1) gat.plot(ax=ax, show=False) report.add_figs_to_section(fig, 'right_SVR', subject + 'Target') print('right_SVR', 'Target') gat = gat_angle2 angles = np.array(events['left_angle'].as_matrix(), float) gat.fit(epochs, y=angles) gat.score(epochs, y=angles)
gat_class = GeneralizationAcrossTime(n_jobs=-1) for subject in subjects: report = OnlineReport() # target ------------------------------------------------------------------ epochs, events = load(subject, 'Target') epochs.resample(64) # Decode angles ----------------------------------------------------------- gat = gat_angle angles = np.array(events['left_angle'].as_matrix(), float) gat.fit(epochs, y=angles) score = gat.score(epochs, y=angles) fig, ax = plt.subplots(1) gat.plot(ax=ax, show=False) report.add_figs_to_section(fig, 'left_angle', subject + 'Target') all_left_angle = list() all_left_angle.append(score) print('left_angle', 'Target') plt.matshow(np.mean(all_left_angle, axis=0)) report.add_figs_to_section(fig, 'All_left_angle', subject + 'Target') angles = np.array(events['right_angle'].as_matrix(), float) gat.fit(epochs, y=angles) gat.score(epochs, y=angles) fig, ax = plt.subplots(1) gat.plot(ax=ax, show=False) report.add_figs_to_section(fig, 'right_angle', subject + 'Target') print('right_angle', 'Target') # Decode Spatial_Frequency -----------------------------------------------------------