[type]: [description] """ X = epochs.copy().crop(crop[0], crop[1]).get_data() num = X.shape[0] y = np.zeros(num, ) + label print(f'Got paired X: {X.shape} and y: {y.shape}') return X, y # %% for idx in range(1, 11): # Loading data ------------------------------------------ running_name = f'MEG_S{idx:02d}' band_name = 'U07' worker = MEG_Worker(running_name=running_name) worker.pipeline(band_name=band_name) # MVPA ---------------------------------------------------------------- # Prepare classifiers _svm = svm.SVC(gamma='scale', kernel='rbf', class_weight='balanced') clf = make_pipeline(Vectorizer(), StandardScaler(), _svm) # Prepare paired X and y # Set crop crops = dict(a=(0.2, 0.4), b=(0.4, 0.6), c=(0.6, 0.8), d=(0.2, 0.8), e=(0.0, 1.0))
np.save(os.path.join(TMP_DIR, f'{compare_name}.npy'), entropy_matrix) print(f'Done {compare_name}') # %% for idx in [1]: # range(1, 11): # Setting ------------------------------------------- running_name = f'MEG_S{idx:02d}' plt.style.use('ggplot') # Worker pipeline ----------------------------------- worker = MEG_Worker(running_name=running_name) worker.pipeline(band_name=BAND_NAME) # Compute segments ---------------------------------- # Init empty segments and segment_data segments = dict() segment_data = dict() # Set values for key in SEGMENT_RANGES: crop = SEGMENT_RANGES[key]['crop'] segments[key] = worker.clean_epochs.copy().crop(crop[0], crop[1]) segment_data[key] = np.mean(segments[key].get_data(), axis=-1) # --------------------------------------------------------------------- # Set up number of sensors
# %% import os import sys # Local tools ----------------------------------- sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'tools')) # noqa from MEG_worker import MEG_Worker # %% worker = MEG_Worker(running_name='MEG_S01') worker.pipeline(band_name='U07')