|
| 1 | +import itertools |
| 2 | +import warnings |
| 3 | +import os |
| 4 | +from sklearn.svm import LinearSVC |
| 5 | +from sklearn.pipeline import make_pipeline |
| 6 | +from joblib import Parallel, delayed |
| 7 | +from nilearn.input_data import NiftiMasker |
| 8 | +from fmralign.alignment_methods import OptimalTransportAlignment |
| 9 | +from fmralign-benchmark-mockup.utils import try_methods_decoding, find_method_label, experiments_variables, fetch_align_decode_data, _check_srm_params, fetch_resample_basc, WHOLEBRAIN_DATASETS, ROI_DATASETS, inter_subject_align_decode |
| 10 | +from fmralign-benchmark-mockup.conf import ROOT_FOLDER, N_JOBS |
| 11 | +warnings.filterwarnings(action='once') |
| 12 | + |
| 13 | +input_methods = ["anat_inter_subject", "pairwise_scaled_orthogonal", |
| 14 | + "pairwise_ot_e-1", "srm", "intra_subject", "HA"] |
| 15 | + |
| 16 | +###### EXPERIMENT 1 ####### |
| 17 | +# Inter-subject results |
| 18 | +experiment_parameters = list(itertools.product( |
| 19 | + WHOLEBRAIN_DATASETS, input_methods)) |
| 20 | + |
| 21 | +Parallel(n_jobs=1)(delayed(inter_subject_align_decode)(input_method, dataset_params, clustering, |
| 22 | + ROOT_FOLDER, n_pieces=n_pieces, n_jobs=N_JOBS) for dataset_params, input_method in experiment_parameters) |
| 23 | +# Within-subject results |
| 24 | +Parallel(n_jobs=1)(delayed(within_subject_decoding)(dataset_params, root_folder) |
| 25 | + for dataset_params in WHOLEBRAIN_DATASETS) |
| 26 | + |
| 27 | +###### EXPERIMENT 2 ####### |
| 28 | + |
| 29 | +experiment_parameters = list(itertools.product(ROI_DATASETS, input_methods)) |
| 30 | +Parallel(n_jobs=1)(delayed(inter_subject_align_decode)(input_method, dataset_params, clustering, |
| 31 | + ROOT_FOLDER, n_pieces=n_pieces, n_jobs=N_JOBS) for dataset_params, input_method in experiment_parameters) |
0 commit comments