starcrm
from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt

y_test = [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
y_pred = [0, 1, 0, 0, 0, 0, 0, 1, 1, 1]
confusion_matrix = confusion_matrix(y_test, y_pred)
print(confusion_matrix)
plt.matshow(confusion_matrix)
plt.title(\'Confusion matrix\')
plt.colorbar()
plt.ylabel(\'True label\')
plt.xlabel(\'Predicted label\')
plt.show()
[[4 1]
 [2 3]]


分类:

技术点:

相关文章:

猜你喜欢
  • 2021-08-14
  • 2021-09-30
  • 2021-08-05
  • 2021-11-18
相关资源
相似解决方案