From 7bb11288c173924f05de7c32c1d9d4b4c18862c8 Mon Sep 17 00:00:00 2001
From: Luc Giffon <luc.giffon@lis-lab.fr>
Date: Fri, 22 Nov 2019 17:40:44 +0100
Subject: [PATCH] solve bug scoring multiclas

---
 code/bolsonaro/models/omp_forest_classifier.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/code/bolsonaro/models/omp_forest_classifier.py b/code/bolsonaro/models/omp_forest_classifier.py
index 02c993c..e121ac7 100644
--- a/code/bolsonaro/models/omp_forest_classifier.py
+++ b/code/bolsonaro/models/omp_forest_classifier.py
@@ -98,8 +98,7 @@ class OmpForestMulticlassClassifier(OmpForest):
         predictions = self.predict(X)
 
         if metric == 'indicator':
-            # todo corriger bug ici
-            evaluation = np.abs(np.mean(np.abs(np.sign(predictions) - y) - 1))
+            evaluation = np.sum(np.ones_like(predictions)[predictions == y]) / X.shape[0]
         else:
             raise ValueError("Unsupported metric '{}'.".format(metric))
 
-- 
GitLab