From cc9781097bd0835799721f748a7ef954782ebecf Mon Sep 17 00:00:00 2001 From: FlorianSchepersAA <163116895+FlorianSchepersAA@users.noreply.github.com> Date: Tue, 9 Apr 2024 14:52:36 +0200 Subject: [PATCH] feat: Round values in graphic of the confusion matrix (#721) TASK: IL-347 --- src/examples/issue_classification_user_journey.ipynb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/examples/issue_classification_user_journey.ipynb b/src/examples/issue_classification_user_journey.ipynb index 7cb80a63e..ec840aad9 100644 --- a/src/examples/issue_classification_user_journey.ipynb +++ b/src/examples/issue_classification_user_journey.ipynb @@ -43,8 +43,6 @@ "outputs": [], "source": [ "### Helper methods ###\n", - "\n", - "\n", "def display_histograms(\n", " expected_labels_histogram: dict[str, int],\n", " predicted_labels_histogram: dict[str, int],\n", @@ -95,7 +93,14 @@ "\n", " for i in range(len(expected_labels)):\n", " for j in range(len(predicted_labels)):\n", - " ax.text(j, i, cross_table_values[i, j], ha=\"center\", va=\"center\", color=\"w\")\n", + " ax.text(\n", + " j,\n", + " i,\n", + " round(cross_table_values[i, j]),\n", + " ha=\"center\",\n", + " va=\"center\",\n", + " color=\"w\",\n", + " )\n", "\n", " ax.set_title(\"Confusion Matrix of Expected vs Predicted Labels\")\n", " ax.set_xlabel(\"Predicted Labels\")\n",