📜  在混淆矩阵上打印标签 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:16.042000             🧑  作者: Mango

代码示例2
import pandas as pd
cmtx = pd.DataFrame(
    confusion_matrix(y_true, y_pred, labels=['yes', 'no']), 
    index=['true:yes', 'true:no'], 
    columns=['pred:yes', 'pred:no']
)
print(cmtx)
# Output:
#           pred:yes  pred:no
# true:yes         1        2
# true:no          0        3