Skip to content

Instantly share code, notes, and snippets.

@HeenaR17
Created October 25, 2020 19:32
Show Gist options
  • Save HeenaR17/b97a103e6fab84e9d1330a88c443d699 to your computer and use it in GitHub Desktop.
Save HeenaR17/b97a103e6fab84e9d1330a88c443d699 to your computer and use it in GitHub Desktop.
from sklearn.metrics import confusion_matrix
nb_cm = confusion_matrix(y_test, nb_y_pred)
plt.figure(figsize=(10,7))
sns.heatmap(data=nb_cm, annot=True, cmap="Blues", xticklabels=['Real', 'Fake'], yticklabels=['Real', 'Fake'])
plt.xlabel('Predicted values')
plt.ylabel('Actual values')
plt.title('Confusion Matrix for Multinomial Naive Bayes Algorithm')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment