figure size plot confusion matrix in scikit learn

To change the default of sklearn metrics package we should do:

fig, ax = plt.subplots(figsize=(20, 20))plot_confusion_matrix(clf, X_test, y_test, cmap=plt.cm.Blues, ax=ax)plot.show()

example:

from sklearn.metrics import plot_confusion_matrixfig, ax = plt.subplots(figsize=(15, 15))
plot_confusion_matrix(slf_4, X_test, y_test, normalize='true', cmap=plt.cm.Blues, ax=ax)
plt.show()
Image for post
Image for post

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store