Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -87,12 +87,15 @@ def plot_confusion_matrix_beamPred(cm, classes, title, save_path, theme='Dark'):
|
|
87 |
plt.figure(figsize=(10, 10))
|
88 |
|
89 |
# Plot the confusion matrix with a colormap compatible for the mode
|
90 |
-
|
91 |
-
|
|
|
|
|
|
|
92 |
|
93 |
# Add F1-score to the title
|
94 |
plt.title(f"{title}\nF1 Score: {avg_f1:.3f}", color=text_color, fontsize=23)
|
95 |
-
|
96 |
tick_marks = np.arange(len(classes))
|
97 |
plt.xticks(tick_marks, classes, color=text_color, fontsize=14) # Adjust text color based on the mode
|
98 |
plt.yticks(tick_marks, classes, color=text_color, fontsize=14) # Adjust text color based on the mode
|
|
|
87 |
plt.figure(figsize=(10, 10))
|
88 |
|
89 |
# Plot the confusion matrix with a colormap compatible for the mode
|
90 |
+
sns.heatmap(cm, cmap=cmap, cbar=True)
|
91 |
+
|
92 |
+
cbar = ax.collections[0].colorbar
|
93 |
+
cbar.ax.yaxis.set_tick_params(color=text_color)
|
94 |
+
cbar.ax.yaxis.set_tick_params(labelcolor=text_color)
|
95 |
|
96 |
# Add F1-score to the title
|
97 |
plt.title(f"{title}\nF1 Score: {avg_f1:.3f}", color=text_color, fontsize=23)
|
98 |
+
|
99 |
tick_marks = np.arange(len(classes))
|
100 |
plt.xticks(tick_marks, classes, color=text_color, fontsize=14) # Adjust text color based on the mode
|
101 |
plt.yticks(tick_marks, classes, color=text_color, fontsize=14) # Adjust text color based on the mode
|