【问题标题】:ROC curve plot: 0.50 significant and cross-validationROC 曲线图:0.50 显着性和交叉验证
【发布时间】:2014-01-13 21:05:08
【问题描述】:

我在使用 pROC 包绘制 ROC 曲线时遇到了两个问题。

A. 显着性水平或 P 值是当 ROC 曲线下的真实(总体)面积实际上为 0.5(零假设:面积 = 0.5)。如果 P 较小(P

因此,我想计算ROC曲线下的某个面积是否与0.50有显着差异。我找到了使用 pROC 包比较两条 ROC 曲线的代码,如下所示,但不确定如何测试它是否为 0.5 显着。

library(pROC)  
data(aSAH)    

rocobj1 <- plot.roc(aSAH$outcome, aSAH$s100,  
                    main="Statistical comparison", 
                    percent=TRUE, col="#1c61b6")  

rocobj2 <- lines.roc(aSAH$outcome, aSAH$ndka, 
                     percent=TRUE, col="#008600")  

testobj <- roc.test(rocobj1, rocobj2)  
text(50, 50, 
     labels=paste("p-value =", format.pval(testobj$p.value)), 
     adj=c(0, .5))  

legend("bottomright", legend=c("S100B", "NDKA"), 
       col=c("#1c61b6", "#008600"), lwd=2)

B. 我已经对我的分类问题进行了 k 折交叉验证。例如,5 折交叉验证将产生 5 条 ROC 曲线。那么如何使用 pROC 包绘制这 5 条 ROC 曲线的平均值(我想要做的是在这个网页上解释,但在 Python 中完成:enter link description here)?另一件事是我们能否得到这条平均 ROC 曲线的置信区间和最佳阈值(类似于下面实现的代码)?

    rocobj <- plot.roc(aSAH$outcome, aSAH$s100b,  
                       main="Confidence intervals", 
                       percent=TRUE,  ci=TRUE, # compute AUC (of AUC by default)  
                       print.auc=TRUE) # print the AUC (will contain the CI)  

    ciobj <- ci.se(rocobj, # CI of sensitivity  
                   specificities=seq(0, 100, 5)) # over a select set of specificities  
    plot(ciobj, type="shape", col="#1c61b6AA") # plot as a blue shape  
    plot(ci(rocobj, of="thresholds", thresholds="best")) # add one threshold

参考:

http://web.expasy.org/pROC/screenshots.html

http://scikit-learn.org/0.13/auto_examples/plot_roc_crossval.html

http://www.talkstats.com/showthread.php/14487-ROC-significance

http://www.medcalc.org/manual/roc-curves.php

【问题讨论】:

  • 这应该是两个不同的问题。

标签: r cross-validation roc


【解决方案1】:

A.使用 wilcox.test 即可。

B.请参阅我对这个问题的回答:Feature selection + cross-validation, but how to make ROC-curves in R 并简单地将交叉验证的每一折中的数据连接起来(但不要使用 bootstrap、LOO、当您多次重复整个交叉验证或预测时)无法在运行之间进行比较)。

【讨论】:

    猜你喜欢
    • 2012-09-11
    • 2018-01-15
    • 2021-05-08
    • 2020-01-02
    • 2021-01-30
    • 2019-08-15
    • 2021-05-06
    • 2023-03-05
    • 2018-01-20
    相关资源
    最近更新 更多