figure size plot confusion matrix in scikit learn

Panjeh
1 min readJun 22, 2020

--

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()

--

--

Panjeh
Panjeh

Written by Panjeh

Posting about Python and Laravel

No responses yet