diff --git a/examples/benchmarks/geolifeclef/geolifeclef2024_pre_extracted/config/glc24_cnn_multimodal_ensemble_habitat.yaml b/examples/benchmarks/geolifeclef/geolifeclef2024_pre_extracted/config/glc24_cnn_multimodal_ensemble_habitat.yaml index 6a9965c2..4fbc611a 100644 --- a/examples/benchmarks/geolifeclef/geolifeclef2024_pre_extracted/config/glc24_cnn_multimodal_ensemble_habitat.yaml +++ b/examples/benchmarks/geolifeclef/geolifeclef2024_pre_extracted/config/glc24_cnn_multimodal_ensemble_habitat.yaml @@ -3,8 +3,8 @@ hydra: dir: outputs/${hydra.job.name}/${now:%Y-%m-%d_%H-%M-%S} run: - predict: false - checkpoint_path: # "outputs/glc24_cnn_multimodal_ensemble_habitat/2024-08-30_20-21-26_multiclass/last.ckpt" + predict: true + checkpoint_path: "outputs/glc24_cnn_multimodal_ensemble_habitat/2024-09-10_01-42-06_multiclass_correct_split/last.ckpt" data: root: "dataset/geolifeclef-2024_habitats/" @@ -18,8 +18,8 @@ data: bioclim_data_dir: "${data.root}TimeSeries-Cubes/TimeSeries-Cubes/GLC24-PA-test-bioclimatic_monthly/" sentinel_data_dir: "${data.root}PA_Test_SatellitePatches_RGB/pa_test_patches_rgb/" metadata_paths: - train: "${data.root}GLC24_PA_metadata_habitats-lvl3_train_split-10.0%_train.csv" - val: "${data.root}GLC24_PA_metadata_habitats-lvl3_train_split-10.0%_val.csv" + train: "${data.root}GLC24_PA_metadata_habitats-lvl3_train_2_split-10.0%_train.csv" + val: "${data.root}GLC24_PA_metadata_habitats-lvl3_train_2_split-10.0%_val.csv" test: "${data.root}GLC24_PA_metadata_habitats-lvl3_test.csv" num_classes: &num_classes 174 download_data: True diff --git a/examples/benchmarks/geolifeclef/geolifeclef2024_pre_extracted/evaluate_inference_MME_habitat.py b/examples/benchmarks/geolifeclef/geolifeclef2024_pre_extracted/evaluate_inference_MME_habitat.py index 6f61134d..dd6c7427 100644 --- a/examples/benchmarks/geolifeclef/geolifeclef2024_pre_extracted/evaluate_inference_MME_habitat.py +++ b/examples/benchmarks/geolifeclef/geolifeclef2024_pre_extracted/evaluate_inference_MME_habitat.py @@ -27,7 +27,7 @@ BOLD = "\033[1m" # 0. Load data -df = pd.read_csv('GLC24_habitat_predictions_multiclass_val-dataset.csv') +df = pd.read_csv('predictions_and_evaluation/predictions_GLC24_SOLUTION_FILE.csv') df['target_habitat_id'] = df['target_habitat_id'].astype(str) df_gt = df.copy() df_preds = df.copy() @@ -104,12 +104,6 @@ elif TASK == 'multiclass': # 1. Convert data to usable types and compute one-hot encodings - res = pd.DataFrame(columns=['Accuracy', - 'Precision_micro', 'Recall_micro', 'F1_micro', - 'Precision_samples', 'Recall_samples', 'F1_samples', - 'Precision_macro', 'Recall_macro', 'F1_macro', - 'AUC_micro', 'AUC_samples', 'AUC_macro']) - idx = np.arange(len(all_predictions_topk_oh)).reshape(-1, 1) all_targets_oh[idx, targets] = 1 # One-hot encode the targets all_probas = probas[idx, np.argsort(preds, axis=1)] # Sort the probabilities in class order @@ -135,6 +129,6 @@ print(f"Top-{topk} Accuracy_multiclass: {acc}") # 4. Save results - res.loc[0] = prfs | accs + res = pd.DataFrame({k: [v] for k, v in (prfs | accs).items()}) res.to_csv('Inference_PRC-ACC.csv', index=False) print('\nResults saved to Inference_PRC-ACC.csv') diff --git a/examples/benchmarks/geolifeclef/geolifeclef2024_pre_extracted/predictions_and_evaluation/Inference_PRC-ACC_habitats_lvl3_predictions_correct_split.csv b/examples/benchmarks/geolifeclef/geolifeclef2024_pre_extracted/predictions_and_evaluation/Inference_PRC-ACC_habitats_lvl3_predictions_correct_split.csv new file mode 100644 index 00000000..431b7727 --- /dev/null +++ b/examples/benchmarks/geolifeclef/geolifeclef2024_pre_extracted/predictions_and_evaluation/Inference_PRC-ACC_habitats_lvl3_predictions_correct_split.csv @@ -0,0 +1,2 @@ +Precision_micro_top-1,Recall_micro_top-1,F1_micro_top-1,Precision_samples_top-1,Recall_samples_top-1,F1_samples_top-1,Precision_macro_top-1,Recall_macro_top-1,F1_macro_top-1,Precision_micro_top-3,Recall_micro_top-3,F1_micro_top-3,Precision_samples_top-3,Recall_samples_top-3,F1_samples_top-3,Precision_macro_top-3,Recall_macro_top-3,F1_macro_top-3,Precision_micro_top-5,Recall_micro_top-5,F1_micro_top-5,Precision_samples_top-5,Recall_samples_top-5,F1_samples_top-5,Precision_macro_top-5,Recall_macro_top-5,F1_macro_top-5,Accuracy_multiclass_top-1,Accuracy_multiclass_top-3,Accuracy_multiclass_top-5 +0.337773042088439,0.337773042088439,0.337773042088439,0.337773042088439,0.337773042088439,0.337773042088439,0.20480480687172334,0.18039238248849737,0.1588256540889949,0.17812111525483929,0.5343633457645178,0.2671816728822589,0.17812111525483929,0.5343633457645178,0.2671816728822589,0.11471821920023804,0.33961951262661966,0.14604822765115621,0.12360149174214172,0.6180074587107086,0.20600248623690287,0.1236014917421417,0.6180074587107086,0.20600248623690284,0.07785807970266735,0.41477541996937306,0.11795281024254056,0.337773042088439,0.5343633457645178,0.6180074587107086