Created
September 12, 2020 05:58
-
-
Save PhilipPurwoko/c28db23a780c5574e73bf4f47fbc7d4d 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
# Import confusion matrix dari sklearn | |
from sklearn.metrics import confusion_matrix | |
# Membuat funsi untuk menampilkan confusion matrix dengan seaborn dan matplotlib | |
def display_conf(y_test,prediction): | |
sns.heatmap(confusion_matrix(y_test,prediction),annot=True,linewidths=3,cbar=False) | |
plt.title('Confusion Matrix') | |
plt.ylabel('Actual') | |
plt.xlabel('Prediction') | |
plt.show() | |
# Memanggil fungsi untuk menampilkan visualisasi confusion matrix | |
display_conf(y_test,prediction) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment