From df25d96ff217176507a4ebdecd1b8159ed9b07d8 Mon Sep 17 00:00:00 2001 From: Dahun Kim Date: Wed, 29 Sep 2021 18:25:03 +0900 Subject: [PATCH] add compute_auc --- tools/compute_auc.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tools/compute_auc.py diff --git a/tools/compute_auc.py b/tools/compute_auc.py new file mode 100644 index 0000000..93c1fe8 --- /dev/null +++ b/tools/compute_auc.py @@ -0,0 +1,11 @@ +import numpy as np +from sklearn import metrics + +# K (number of shots) +x = np.array([1., 10., 30., 50., 100., 300., 500., 1000.]) +x_log = np.log(x) / np.log(1000) +# Average Recall scores +y = np.array([0.0, 18.0, 26.5, 29.6, 33.4, 39.0, 41.5, 45.0]) +y *= 0.01 +auc = metrics.auc(x_log, y) +print('AUC score:', auc) \ No newline at end of file