ROC 曲线 - 该图未按预期显示

ROC curve - the plot does not show as it is expceted

我正在尝试使用 pyhton matplotlib 库绘制 ROC 曲线图。我想将曲线显示为带有标记的碟形线,如下图所示: 图参考:https://www.biorxiv.org/content/10.1101/2019.12.21.885491v1.full

这是我的代码:

plt.figure(figsize=(7,7))
fpr, tpr, thresholds = metrics.roc_curve(test_Y, predict_proba)
auc = roc_auc_score(test_Y,y_pred)
plt.plot(fpr, tpr, label='%s (AUC = %0.2f)' % ("LR", auc),marker='h',linestyle='--')
plt.plot([0, 1], [0, 1],'r--',label='No skills')
plt.xlim([-0.02, 1])
plt.ylim([0, 1.02])
plt.xlabel('False Positive Rate (%)')
plt.ylabel('True Positive Rate (%)')
plt.title('ROC Curve')
plt.legend(loc="lower right")
plt.grid()

这是我得到的情节:

整行都打印了'marker',好像哪里出了问题。 如果我从 plot 函数中删除了 marker 参数,我得到了这个:

我真的不知道为什么会这样。是我画图的方式有问题,还是模型结果有问题。

谁能帮我解决这个问题。

在传入的每个数据点都使用标记。是否要绘制整条曲线但仅在每个数据点显示标记? 10点?如果是,试试这个:

plt.plot(fpr, tpr, linestyle='--')
plt.plot(fpr[::10], tpr[::10], marker='h')