【问题标题】:cross validation output interpretation from survival analysis生存分析的交叉验证输出解释
【发布时间】:2021-03-17 21:32:05
【问题描述】:

我已经使用 errorest 函数执行了交叉验证,但不确定如何解释输出的 Brier 分数。有没有办法可视化交叉验证?任何其他关于如何执行可视化 CV 的建议。

library(ipred)


    df.t <- structure(list(time = c(1796, 1644.04166666667, 
    606.041666666667, 1327.04166666667, 665, 2461, 1824, 1554.04166666667, 
    601.958333333333, 1638.95833333333), status = c(0L, 
    0L, 1L, 0L, 1L, 0L, 0L, 0L, 1L, 1L), Comb2 = c("Low", "Low", 
    "High", "Low", "High", "Low", "Low", "High", "High", "Low")), row.names = c("1025", 
    "1101", "1198", "1330", "1393", "1428", "1473", "1676", "175", 
    "1754"), class = "data.frame")


    err <- errorest(Surv(time, status) ~Comb2, data=df.t, model=survfit,
         predict=NULL, est.para=control.errorest(k=5))

出来:

Call:
errorest.data.frame(formula = Surv(time, status) ~ Comb2, data = df.t.top, 
    model = survfit, predict = NULL, est.para = control.errorest(k = 5))

     5-fold cross-validation estimator of Brier's score

Brier's score:  0.2622 

【问题讨论】:

    标签: cross-validation survival-analysis


    【解决方案1】:

    我无法让您的代码正常工作,因此无法重现上述内容,但是有些 cmets:

    1. brier 分数是一种评分规则,在生存环境中没有已知的基线值。这意味着您实际上无法单独解释此值,“0.2622”可能是“好”或“坏”,但没有其他模型与之比较是没有意义的。

    2. 跨折叠可视化分数也不能提供有用的信息。您应该只查看所有折叠的平均分数。

    3. 可视化简历也没有意义。 CV 的目的是获得所有折叠的平均预测,折叠之间的检查不能提供有用的信息。

    由于您要求其他建议,我将插入我的包,它可以轻松获得预测、比较多个模型以及可视化预测误差曲线。以下是您的数据示例:

    library(mlr3); library(mlr3proba)
    
    set.seed(1)
    
    # create data
    df.t <- data.frame(
      time = c(1796, 1644.04166666667, 
               606.041666666667, 1327.04166666667, 665, 2461, 1824, 1554.04166666667, 
               601.958333333333, 1638.95833333333),
      status = c(0L, 0L, 1L, 0L, 1L, 0L, 0L, 0L, 1L, 1L),
      Comb2 = factor(c("Low", "Low",  "High", "Low", "High",
     "Low", "Low", "High", "High", "Low"))
    )
    rownames(df.t) <- c("1025",  "1101", "1198", "1330", "1393", "1428", "1473", "1676", 
    "175", "1754")
    
    # convert data to 'task'
    task = TaskSurv$new("dft", df.t, time = "time", event = "status")
    
    # get Cox PH learner
    cox = lrn("surv.coxph")
    
    # use 5-fold cross-validation
    cv = rsmp("cv", folds = 5)
    
    # resample
    rr = resample(task, cox, cv)
    
    # get brier/graf score
    rr$aggregate(msr("surv.brier"))
    
    # get prediction
    rr$prediction()
    
    # inspect individual predictions
    rr$predictions("test")
    
    # compare to Kaplan-Meier baseline
    km = lrn("surv.kaplan")
    
    # make benchmark experiment
    design = benchmark_grid(task, list(cox, km), cv)
    
    # run experiment
    bm = benchmark(design)
    
    # get brier score
    bm$aggregate(msr("surv.brier"))
    

    【讨论】:

    • 您的 CV 没有为每一折做出新的特征选择?所以那里会有偏见。
    • 我不知道你指的是什么,这是标准的交叉验证。也许我误解了你的问题,尽管在你原来的帖子中看起来你的模型只使用了一个功能?
    猜你喜欢
    • 1970-01-01
    • 2018-09-09
    • 2016-12-01
    • 2017-04-22
    • 1970-01-01
    • 1970-01-01
    • 2018-03-12
    • 2015-04-30
    • 1970-01-01
    相关资源
    最近更新 更多