Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -191,14 +191,14 @@ def plot_confusion_matrix_from_csv(csv_file_path, title, save_path, light_mode=F
|
|
191 |
sns.heatmap(cm, annot=True, fmt="d", cmap=cmap, cbar=False, annot_kws={"size": 12}, linewidths=0.5, linecolor='white')
|
192 |
|
193 |
# Add F1-score to the title
|
194 |
-
plt.title(f"{title}\n(F1 Score: {f1:.3f})", color=text_color, fontsize=
|
195 |
|
196 |
# Customize tick labels for light/dark mode
|
197 |
-
plt.xticks([0.5, 1.5], labels=['Class 0', 'Class 1'], color=text_color, fontsize=
|
198 |
-
plt.yticks([0.5, 1.5], labels=['Class 0', 'Class 1'], color=text_color, fontsize=
|
199 |
|
200 |
-
plt.ylabel('True label', color=text_color, fontsize=
|
201 |
-
plt.xlabel('Predicted label', color=text_color, fontsize=
|
202 |
plt.tight_layout()
|
203 |
|
204 |
# Save the plot as an image
|
@@ -362,14 +362,14 @@ def plot_confusion_matrix(y_true, y_pred, title, light_mode=False):
|
|
362 |
sns.heatmap(cm, annot=True, fmt="d", cmap=cmap, cbar=False, annot_kws={"size": 12}, linewidths=0.5, linecolor='white')
|
363 |
|
364 |
# Add F1-score to the title
|
365 |
-
plt.title(f"{title}\nF1 Score: {f1:.3f}", color=text_color, fontsize=
|
366 |
|
367 |
# Customize tick labels for dark mode
|
368 |
-
plt.xticks([0.5, 1.5], labels=['Class 0', 'Class 1'], color=text_color, fontsize=
|
369 |
-
plt.yticks([0.5, 1.5], labels=['Class 0', 'Class 1'], color=text_color, fontsize=
|
370 |
|
371 |
-
plt.ylabel('True label', color=text_color, fontsize=
|
372 |
-
plt.xlabel('Predicted label', color=text_color, fontsize=
|
373 |
plt.tight_layout()
|
374 |
|
375 |
# Save the plot as an image
|
|
|
191 |
sns.heatmap(cm, annot=True, fmt="d", cmap=cmap, cbar=False, annot_kws={"size": 12}, linewidths=0.5, linecolor='white')
|
192 |
|
193 |
# Add F1-score to the title
|
194 |
+
plt.title(f"{title}\n(F1 Score: {f1:.3f})", color=text_color, fontsize=18)
|
195 |
|
196 |
# Customize tick labels for light/dark mode
|
197 |
+
plt.xticks([0.5, 1.5], labels=['Class 0', 'Class 1'], color=text_color, fontsize=12)
|
198 |
+
plt.yticks([0.5, 1.5], labels=['Class 0', 'Class 1'], color=text_color, fontsize=12)
|
199 |
|
200 |
+
plt.ylabel('True label', color=text_color, fontsize=14)
|
201 |
+
plt.xlabel('Predicted label', color=text_color, fontsize=14)
|
202 |
plt.tight_layout()
|
203 |
|
204 |
# Save the plot as an image
|
|
|
362 |
sns.heatmap(cm, annot=True, fmt="d", cmap=cmap, cbar=False, annot_kws={"size": 12}, linewidths=0.5, linecolor='white')
|
363 |
|
364 |
# Add F1-score to the title
|
365 |
+
plt.title(f"{title}\nF1 Score: {f1:.3f}", color=text_color, fontsize=18)
|
366 |
|
367 |
# Customize tick labels for dark mode
|
368 |
+
plt.xticks([0.5, 1.5], labels=['Class 0', 'Class 1'], color=text_color, fontsize=12)
|
369 |
+
plt.yticks([0.5, 1.5], labels=['Class 0', 'Class 1'], color=text_color, fontsize=12)
|
370 |
|
371 |
+
plt.ylabel('True label', color=text_color, fontsize=14)
|
372 |
+
plt.xlabel('Predicted label', color=text_color, fontsize=14)
|
373 |
plt.tight_layout()
|
374 |
|
375 |
# Save the plot as an image
|