-
-
Save AI-MOO/b51986802604e948e6f0bccc80a48d9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# استيراد المكتبات | |
from sklearn.metrics import confusion_matrix | |
import seaborn as sns | |
# Confusion Matrix استخراج قيم مصفوفة الدقة | |
cm = confusion_matrix(y_test, SVC_prediction, normalize='true') | |
# Heat Map تصوير المفوفة عن طريق الخريطة الحرارية | |
fig, ax = plt.subplots(figsize=(14,7)) | |
sns.set(font_scale=3.0) # Adjust to fit | |
sns.heatmap(cm, annot=True, annot_kws={"fontsize":15}, cmap="Blues", fmt=".3f", ax=ax); | |
# Heat Map تفضيلات الخريطة الحرارية | |
label_font = {'size':'15'} | |
ax.set_xlabel('Predicted labels', fontdict=label_font); | |
ax.set_ylabel('Actual labels', fontdict=label_font); | |
title_font = {'size':'20'} | |
ax.set_title('Confusion Matrix', fontdict=title_font); | |
ax.tick_params(axis='both', which='major', labelsize=10) | |
ax.xaxis.set_ticklabels(clf.classes_ , rotation = 25); | |
ax.yaxis.set_ticklabels(clf.classes_, rotation=0.5); | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment