From f659431ae44fb4b2c2fe8c42b27c2bf2c0e9162b Mon Sep 17 00:00:00 2001 From: Jaydip Patel <02patelj61@MSASafety.com> Date: Fri, 30 Aug 2024 09:31:55 -0400 Subject: [PATCH] Update function make_confusion_metrix to have vertical xticklables --- extras/helper_functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/helper_functions.py b/extras/helper_functions.py index a5d604f3..30a23158 100644 --- a/extras/helper_functions.py +++ b/extras/helper_functions.py @@ -81,13 +81,13 @@ def make_confusion_matrix(y_true, y_pred, classes=None, figsize=(10, 10), text_s xlabel="Predicted label", ylabel="True label", xticks=np.arange(n_classes), # create enough axis slots for each class - yticks=np.arange(n_classes), - xticklabels=labels, # axes will labeled with class names (if they exist) or ints + xticklabels=labels, yticklabels=labels) # Make x-axis labels appear on bottom ax.xaxis.set_label_position("bottom") ax.xaxis.tick_bottom() + ax.set_xticklabels(labels, rotation=90) # axes will labeled with class names (if they exist) or ints # Set the threshold for different colors threshold = (cm.max() + cm.min()) / 2.