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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With