Plot_confusioin_matrix plot is not showing integer value instead it is showing some exponential value
Asked Answered
P

1

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.

Party answered 30/1, 2020 at 16:26 Comment(0)
E
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

Embree answered 31/1, 2020 at 5:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.