from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt
import numpy
import seaborn as sns
cm = numpy.array([[ 6, 94],[ 80, 821 ]])
fig, ax = plt.subplots(figsize=(10,10)) # Adjust to fit
sns.set(font_scale=1.5) # Adjust to fit
sns.heatmap(cm, annot=True, ax=ax, cmap="Blues", fmt="g");
# Labels, title and ticks
label_font = {'size':'15'} # Adjust to fit
ax.set_xlabel('Predicted labels', fontdict=label_font);
ax.set_ylabel('True labels', fontdict=label_font);
title_font = {'size':'20'} # Adjust to fit
ax.set_title('Confusion Matrix', fontdict=title_font);
ax.tick_params(axis='both', which='major', labelsize=20) # Adjust to fit
labels = ['True', 'False']
ax.xaxis.set_ticklabels(labels);
ax.yaxis.set_ticklabels(labels);
plt.show()