6

Confusion Matrix

from sklearn.metrics import confusion_matrix
from sklearn.metrics import plot_confusion_matrix

print('*** Test Accuracy ***',forest.score(X_test,y_test))
disp = plot_confusion_matrix(forest, X_test, y_test,
                                 display_labels=[0,1],
                                 cmap=plt.cm.Blues,
                             values_format='g'
                            )

As one can see , inside the confusion matrix plot , the numbers printed is not integer . required is integer value to plot.

Nabi Shaikh
  • 787
  • 1
  • 6
  • 26

1 Answers1

7

You are instructing the format using values_format='g'. The format g favors using scientific notation when the numbers are large (as in your case)

try passing values_format='d' or values_format='.0f' instead

Diziet Asahi
  • 38,379
  • 7
  • 60
  • 75