From 1d21da8ca186179a6bda042480be4d2788db37ac Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Thu, 18 Jul 2019 15:02:26 +0200 Subject: [PATCH] Fixed dtype of micro and macro precision/recall numpy arrays Signed-off-by: Jim Martens --- src/twomartens/masterthesis/evaluate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/twomartens/masterthesis/evaluate.py b/src/twomartens/masterthesis/evaluate.py index bdcbcdb..8eeb65a 100644 --- a/src/twomartens/masterthesis/evaluate.py +++ b/src/twomartens/masterthesis/evaluate.py @@ -295,8 +295,8 @@ def get_precision_recall(number_gt_per_class: np.ndarray, """ cumulative_precisions = [[]] cumulative_recalls = [[]] - cumulative_precision_micro = np.zeros_like(cumulative_true_positives_micro) - cumulative_recall_micro = np.zeros_like(cumulative_true_positives_micro) + cumulative_precision_micro = np.zeros(cumulative_true_positives_micro.shape, dtype=np.float) + cumulative_recall_micro = np.zeros(cumulative_true_positives_micro.shape, dtype=np.float) cumulative_precision_macro = np.zeros_like(cumulative_precision_micro) cumulative_recall_macro = np.zeros_like(cumulative_recall_micro) total_number_gt = 0