diff --git a/pysegcnn/core/trainer.py b/pysegcnn/core/trainer.py index 516185837d1b5feb64417772d009f76116733552..39e677d1849f232d1e8fe6328d4c296189f372a6 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