<jupyter_start><jupyter_text>EEGNet  For each window size, identify the selected hyperparameter setting for each subject using the AllSubjects_summary.csv<jupyter_code>root_path = 'YOUR_PATH/fNIRS-mental-workload-classifiers/experiments/generic_finetuning_models/EEGNet/binary/'

Finetuning_OtherSubject64_summary_path = 'train_100/64vs4_summary/'

Finetuning_OtherSubject64_df = pd.read_csv(os.path.join(root_path, Finetuning_OtherSubject64_summary_path, 'AllSubjects_summary.csv'))

Finetuning_OtherSubject64_df<jupyter_output><empty_output><jupyter_text>Get 97.5 and 2.5 percentile using bootstrapping To generate 1 bootstrap sample, first sample the 71 subjects to include for this bootstrap sample.Then for each included subject, sample the chunk to calculate accuracy for this subject<jupyter_code>num_bootstrap_samples=5000
upper_percentile=97.5
lower_percentile=2.5

candidate_subjects = np.array([1, 13, 14, 15, 20, 21, 22, 23, 24, 25, 27, 28, 29, 31, 32, 34,
 35, 36, 37, 38, 40, 42, 43, 44, 45, 46, 47, 48, 49,  5, 51, 52,
 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 68, 69,  7, 70, 71,
 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 91, 92, 93,
 94, 95, 97])

len(candidate_subjects)<jupyter_output><empty_output><jupyter_text>OtherSubject64<jupyter_code>lookup_table = Finetuning_OtherSubject64_df.copy()
Finetuning_OtherSubject64_upper_percentile, Finetuning_OtherSubject64_lower_percentile = bootstrapping(candidate_subjects, lookup_table, num_bootstrap_samples=num_bootstrap_samples, upper_percentile=upper_percentile, lower_percentile=lower_percentile)
print('Finetuning_OtherSubject64:')
print('{} percentile is {}; {} percentile is {}'.format(upper_percentile, Finetuning_OtherSubject64_upper_percentile, lower_percentile, Finetuning_OtherSubject64_lower_percentile))

print('{} percentile is {}; {} percentile is {}'.format(upper_percentile, Finetuning_OtherSubject64_upper_percentile, lower_percentile, Finetuning_OtherSubject64_lower_percentile))<jupyter_output>97.5 percentile is 67.76170145477546; 2.5 percentile is 58.03664611005693<jupyter_text>DeepConvNet  For each window size, identify the selected hyperparameter setting for each subject using the AllSubjects_summary.csv<jupyter_code>root_path = 'YOUR_PATH/fNIRS-mental-workload-classifiers/experiments/generic_finetuning_models/DeepConvNet/binary/'

Finetuning_OtherSubject64_summary_path = 'train_100/64vs4_summary/'

Finetuning_OtherSubject64_df = pd.read_csv(os.path.join(root_path, Finetuning_OtherSubject64_summary_path, 'AllSubjects_summary.csv'))

Finetuning_OtherSubject64_df<jupyter_output><empty_output><jupyter_text>Get 97.5 and 2.5 percentile using bootstrapping To generate 1 bootstrap sample, first sample the 71 subjects to include for this bootstrap sample.Then for each included subject, sample the chunk to calculate accuracy for this subject<jupyter_code>num_bootstrap_samples=5000
upper_percentile=97.5
lower_percentile=2.5

candidate_subjects = np.array([1, 13, 14, 15, 20, 21, 22, 23, 24, 25, 27, 28, 29, 31, 32, 34,
 35, 36, 37, 38, 40, 42, 43, 44, 45, 46, 47, 48, 49,  5, 51, 52,
 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 68, 69,  7, 70, 71,
 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 91, 92, 93,
 94, 95, 97])

len(candidate_subjects)<jupyter_output><empty_output><jupyter_text>OtherSubject64<jupyter_code>lookup_table = Finetuning_OtherSubject64_df.copy()
Finetuning_OtherSubject64_upper_percentile, Finetuning_OtherSubject64_lower_percentile = bootstrapping(candidate_subjects, lookup_table, num_bootstrap_samples=num_bootstrap_samples, upper_percentile=upper_percentile, lower_percentile=lower_percentile)
print('Finetuning_OtherSubject64:')
print('{} percentile is {}; {} percentile is {}'.format(upper_percentile, Finetuning_OtherSubject64_upper_percentile, lower_percentile, Finetuning_OtherSubject64_lower_percentile))

print('{} percentile is {}; {} percentile is {}'.format(upper_percentile, Finetuning_OtherSubject64_upper_percentile, lower_percentile, Finetuning_OtherSubject64_lower_percentile))<jupyter_output>97.5 percentile is 67.42607526881719; 2.5 percentile is 57.08807716635042
{'fraction_non_alphanumeric': 0.09828128782377149, 'fraction_numerical': 0.10602759622367465, 'mean_word_length': 8.542725173210162, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 32, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '339913', 'license': 'MIT', 'n_tokens_mistral': 1780, 'n_tokens_neox': 1399, 'n_words': 329, 'path': 'generic_finetuning_models/Bootstrapping_for_GenericFinetuningModels.ipynb', 'repo_name': 'tufts-ml/fNIRS-mental-workload-classifiers', 'size': '4131'}