From 3d948936d4b5b59cc851ca1e85c25fced5464c99 Mon Sep 17 00:00:00 2001 From: "Daniel.Frisinghelli" <daniel.frisinghelli@eurac.edu> Date: Sat, 20 Feb 2021 10:02:02 +0100 Subject: [PATCH] Fixed selection of metrics in report dataframe. --- pysegcnn/core/graphics.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pysegcnn/core/graphics.py b/pysegcnn/core/graphics.py index e419a3c..bd93df9 100644 --- a/pysegcnn/core/graphics.py +++ b/pysegcnn/core/graphics.py @@ -718,13 +718,14 @@ def plot_classification_report(report, labels, figsize=(10, 10), # convert to DataFrame df = report2df(report, labels) - # drop overall accuracy/micro avg + # get overall accuracy try: overall_accuracy = df.loc['accuracy'].loc['f1-score'] - metrics = df.drop(index='accuracy') except KeyError: overall_accuracy = df.loc['micro avg'].loc['f1-score'] - metrics = df.drop(index='micro avg') + + # drop micro avg/accuracy from dataframe + metrics = df.loc[labels + ['macro avg', 'weighted avg']] # create a figure fig, ax = plt.subplots(1, 1, figsize=figsize) -- GitLab