from sklearn.metrics import confusion_matrix matrix_confusion = confusion_matrix(y_test, y_pred) sns.heatmap(matrix_confusion, square=True, annot=True, cmap='Blues', fmt='d', cbar=False