diff --git a/model_selection/test_models.py b/model_selection/test_models.py index bf5697e2e6d49ed54f118b80d0bb3afab098fad7..7e2f94e1771dc33e3fb50706016039cd984b4bca 100644 --- a/model_selection/test_models.py +++ b/model_selection/test_models.py @@ -219,8 +219,8 @@ if __name__ == "__main__": 'FN':FN_scorer, 'FP':FP_scorer, 'TP':TP_scorer, - 'AUROC': make_scorer(roc_auc_score, needs_threshold=True), # AUROC requires decision function or probability outputs - 'AUPRC': make_scorer(average_precision_score, needs_proba=True) # AUPRC requires probability outputs + 'AUROC': make_scorer(roc_auc_score), # AUROC requires decision function or probability outputs + 'AUPRC': make_scorer(average_precision_score) # AUPRC requires probability outputs } method_names = { 0: "ORIG", @@ -235,9 +235,10 @@ if __name__ == "__main__": scores_sheets = {} # To store score dfs as sheets in the same excel file for i, group in enumerate(['pre', 'post']): # Get test dataset based on group - X_test = data_dic['X_test' + group] - y_test = data_dic['y_test' + group] + X_test = data_dic['X_test_' + group] + y_test = data_dic['y_test_' + group] for j, method in enumerate(['', '', 'over_', 'under_']): + print(f"{group}-{method}") # Get train dataset based on group and method X_train = data_dic['X_train_' + method + group] y_train = data_dic['y_train_' + method + group] @@ -259,7 +260,7 @@ if __name__ == "__main__": sheet_name = f"{group}_{method_names[j]}" scores_sheets[sheet_name] = scores_df # Write results to Excel file - with pd.ExcelWriter('./model_selection/test_results/testing_tuned_models.xlsx') as writer: + with pd.ExcelWriter('./test_results/testing_tuned_models.xlsx') as writer: for sheet_name, data in scores_sheets.items(): data.to_excel(writer, sheet_name=sheet_name) # -------------------------------------------------------------------------------------------------------- diff --git a/model_selection/test_results/testing_tuned_models.xlsx b/model_selection/test_results/testing_tuned_models.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..1c0daa5be47052ff8dde569780d264ef84052403 Binary files /dev/null and b/model_selection/test_results/testing_tuned_models.xlsx differ