R中逻辑回归模型的ROC曲线问题

Issues with ROC curves of logistic regression model in R

我对我的数据进行了一些分析,但我发现所有 ROC 图都在图表底部合并了阈值点。是数据本身的问题还是使用的包的问题?

library(ROCR)
ROCRPred = prediction(res2, test_set$WRF)
ROCRPref <- performance(ROCRPred,"tpr","fpr")
plot(ROCRPref, colorize=TRUE, print.cutoffs.at=seq(0.1,by = 0.1))

您为什么选择 0.1 和 1 之间的截止值?

print.cutoffs.at=seq(0.1,by = 0.1)

您需要使它们适应您的数据。例如,您可以使用分位数:

plot(ROCRPref, colorize=TRUE, print.cutoffs.at=quantile(res2))

我认为 "the threshold points are consolidated at the base of the graphs" 由于情节中的参数 'print.cutoffs.at'。

根据文档 print.cutoffs.at:-此向量指定应在相应曲线位置沿曲线打印为文本的截止值。

正如@Calimo 在他根据数据调整阈值的回答中提到的那样。