我正在计算3种不同型号的精确召回分数。对于我的第一个模型,情节不匹配的auc评分是0.85,但应该是0.5。

这是我的代码:
precision, recall, thresholds = precision_recall_curve(y_test, pred1)
print(pred1)
fig, ax = plt.subplots()
ax.plot(recall, precision, color='red')
ax.set_title('Precision-Recall curve')
ax.set_ylabel('Precision')
ax.set_xlabel('Recall')
plt.show()
auc_precision_recall = auc(recall, precision)发布于 2022-08-02 04:18:01
对不起,我没有足够的代表发表评论。
注意你的y轴,它在0.7-1之间,所以AUC为0.85似乎与情节相匹配。如果y轴范围为0-1,则AUC为0.5 .
使用ax.set_ylim((0,1)),可以将y轴设置为0-1之间。
https://stackoverflow.com/questions/73187622
复制相似问题