【问题标题】:ROC curves and AUC of multiple model combinations in RR中多个模型组合的ROC曲线和AUC
【发布时间】:2017-08-26 00:19:59
【问题描述】:

dredge results snapshot我正在使用 MuMin 包中的疏通函数,通过逻辑回归得出多因素组合。

library(MuMIn)
AA <- dredge(Forward.model,evaluate = TRUE,rank = "AIC",m.lim = c(8,13),trace=2)
write.xlsx(AA,File location)

这会产生大约 10000 种不同的模型组合。现在我想计算所有这些组合的 AUC。 R中是否有可以做到这一点的包?我对在 R 中编写循环不是很熟悉。

【问题讨论】:

  • 你能提供dredge函数的输出吗?或者它是什么样子的
  • 我已经编辑了原始帖子并共享了我从疏通功能获得的输出链接。

标签: r roc auc


【解决方案1】:

我会遵循以下步骤:

1) 对于每个模型获取每个样本的预测值。让pred.mat 具有预测的矩阵,其中每行代表一个个体,每列不同的模型,y 具有二分响应变量的向量。

2) 计算每个模型的 AUC

    # Load pROC library (install it if not)
      library(pROC)
    # Compute the AUC values
      auc.val <- apply(pred.mat,2,function(x)roc(pred=x,resp=y)$auc)

因此,auc.val 将显示每个模型的 AUC 值。

【讨论】:

    猜你喜欢
    • 2018-05-29
    • 2015-11-24
    • 2012-04-15
    • 1970-01-01
    • 2019-09-29
    • 2021-03-12
    • 2020-08-15
    • 2016-09-11
    • 1970-01-01
    相关资源
    最近更新 更多