From 52f4982e1c8674351fae17fa15b1c065c8cade1e Mon Sep 17 00:00:00 2001
From: "raffaele.gaetano" <raffaele.gaetano@cirad.fr>
Date: Wed, 12 Jul 2023 14:55:42 +0200
Subject: [PATCH] ENH: optimize report.

---
 Postprocessing/Report.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Postprocessing/Report.py b/Postprocessing/Report.py
index cc2578f..c0eac6f 100644
--- a/Postprocessing/Report.py
+++ b/Postprocessing/Report.py
@@ -28,7 +28,7 @@ def generate_report_figures(map, palette_fn, results, summary, out_dir, map_name
         of['conf_matrices'] = []
         for i,r in enumerate(results):
             cm = ConfusionMatrixDisplay.from_predictions(r['true_vs_pred'][0], r['true_vs_pred'][1],
-                                                         normalize='true', include_values=True)
+                                                         normalize='true', include_values=True, values_format='.2f')
             of['conf_matrices'].append('{}/conf_matrix_{}.png'.format(out_dir, str(i).zfill(2)))
             cm.ax_.set_xticklabels(class_names, rotation=45, ha='right')
             cm.ax_.set_yticklabels(class_names)
@@ -157,7 +157,7 @@ def generate_pdf(of, out_pdf, name='output'):
         for k in list(rep.keys())[:-3] + list(rep.keys())[-2:]:
             table_data.append([k, rep[k]['precision'], rep[k]['recall'], rep[k]['f1-score'], rep[k]['support']])
         pdf.set_xy(0, 150)
-        pdf.set_font("helvetica", '', 10)
+        pdf.set_font("helvetica", '', 6)
         with pdf.table(width=140, col_widths=(60,20,20,20,20)) as table:
             row = table.row()
             for datum in table_data[0]:
-- 
GitLab