From cfe40f9a96b40fd5247dd04fa67be3007037bdcf Mon Sep 17 00:00:00 2001
From: "Daniel.Frisinghelli" <daniel.frisinghelli@eurac.edu>
Date: Tue, 16 Feb 2021 15:08:50 +0100
Subject: [PATCH] Avoid namespace confusion.

---
 pysegcnn/core/trainer.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pysegcnn/core/trainer.py b/pysegcnn/core/trainer.py
index 261fcb7..44b6892 100644
--- a/pysegcnn/core/trainer.py
+++ b/pysegcnn/core/trainer.py
@@ -2736,6 +2736,7 @@ class NetworkInference(BaseConfig):
                 df = pd.concat([df, output['report']], axis=0)
 
             # compute k-fold average estimate of each metric across all models
+            LOGGER.info('Calculating k-fold estimate of metrics ...')
             report = df.groupby(df.index, sort=False).mean()
             inference['report'] = report
 
@@ -2754,8 +2755,8 @@ class NetworkInference(BaseConfig):
                 cm_agg = np.zeros(shape=2 * (len(labels), ))
 
                 # update aggregated confusion matrix
-                for _, output in inference.items():
-                    cm_agg += output['cm']
+                for _, metrics in inference.items():
+                    cm_agg += metrics['cm']
 
                 # save aggregated confusion matrix to dictionary
                 inference['cm'] = cm_agg
-- 
GitLab