Answers for "confusion matrix pytohn"

0

confusion matrix python code

from sklearn.metrics import confusion_matrix
cm = confusion_matrix(y_test, y_predicted)
cm
# after creating the confusion matrix, for better understaning plot the cm.
import seaborn as sn
plt.figure(figsize = (10,7))
sn.heatmap(cm, annot=True)
plt.xlabel('Predicted')
plt.ylabel('Truth')
Posted by: Guest on April-08-2021

Python Answers by Framework

Browse Popular Code Answers by Language