From 222a8066c300df0613cf2180e99a11ccc9368615 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.dos.anjos@gmail.com>
Date: Tue, 5 May 2020 21:27:34 +0200
Subject: [PATCH] [utils.table] Incorporate AUC

---
 bob/ip/binseg/utils/table.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bob/ip/binseg/utils/table.py b/bob/ip/binseg/utils/table.py
index 5feb27f8..e8c4d64c 100644
--- a/bob/ip/binseg/utils/table.py
+++ b/bob/ip/binseg/utils/table.py
@@ -3,6 +3,7 @@
 
 
 import tabulate
+from .metric import auc
 
 
 def performance_table(data, fmt):
@@ -53,6 +54,7 @@ def performance_table(data, fmt):
         "F1\nmax",
         "P\nmax",
         "R\nmax",
+        "AUC",
         ]
 
     table = []
@@ -73,6 +75,8 @@ def performance_table(data, fmt):
         f1max_idx = v["df"].f1_score.idxmax()
         entry.append(v["df"].precision[f1max_idx])
         entry.append(v["df"].recall[f1max_idx])
+        entry.append(auc(v["df"]["recall"].to_numpy(),
+            v["df"]["precision"].to_numpy()))
 
         table.append(entry)
 
-- 
GitLab