Skip to content

Commit

Permalink
ignored files changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tlarcher committed Oct 2, 2024
1 parent 27de1e4 commit d2f0d94
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -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')
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d2f0d94

Please sign in to comment.