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

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

diff --git a/pysegcnn/core/trainer.py b/pysegcnn/core/trainer.py
index 5161858..39e677d 100644
--- a/pysegcnn/core/trainer.py
+++ b/pysegcnn/core/trainer.py
@@ -2733,8 +2733,7 @@ class NetworkInference(BaseConfig):
             df = pd.DataFrame(dtype=float)
             for name, output in inference.items():
                 # classification report DataFrame for all individual models
-                report = output['report']
-                df = pd.concat([df, report], axis=0)
+                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 ...')
@@ -2756,8 +2755,8 @@ class NetworkInference(BaseConfig):
                 cm_agg = np.zeros(shape=2 * (len(labels), ))
 
                 # update aggregated confusion matrix
-                for name, output in inference.items():
-                    cm_agg += output['cm']
+                for value in inference.values():
+                    cm_agg += value['cm']
 
                 # save aggregated confusion matrix to dictionary
                 inference['cm'] = cm_agg
-- 
GitLab