Python 混淆矩阵Sklearn 0.22数字格式错误
我试图使用sklearn 0.22中的plot_Mission_矩阵 但我的数字是1.3e+0.2格式Python 混淆矩阵Sklearn 0.22数字格式错误,python,machine-learning,scikit-learn,data-science,confusion-matrix,Python,Machine Learning,Scikit Learn,Data Science,Confusion Matrix,我试图使用sklearn 0.22中的plot_Mission_矩阵 但我的数字是1.3e+0.2格式 from sklearn.metrics import plot_confusion_matrix plt.figure(figsize=(100, 230)) plot_confusion_matrix(clf, X, y, cmap=plt.cm.Blues) plt.xlabel('True label') plt.ylabel('Predicted label') 如何解决此问题?
from sklearn.metrics import plot_confusion_matrix
plt.figure(figsize=(100, 230))
plot_confusion_matrix(clf, X, y, cmap=plt.cm.Blues)
plt.xlabel('True label')
plt.ylabel('Predicted label')
如何解决此问题?在函数中使用value format参数 以下是使用值\格式参数的示例:
disp = plot_confusion_matrix(classifier, X_test, y_test,
display_labels=class_names,
cmap=plt.cm.Blues,
normalize=normalize,
values_format="d")
如果只想显示浮点值,可以使用以下格式“.1f”。这与seaborn中使用的value\u格式相同。使用代码片段进行解释比使用代码图像更好。请提供value\u格式参数应如何使用的示例。那我就投你的票:)