【问题标题】:GBM in r for coxph loss functionr 中的 GBM 用于 coxph 损失函数
【发布时间】:2017-03-18 05:52:33
【问题描述】:

我在 r 中使用 gbm 来预测生存率(分布 =“coxph”)。

gbm.predict(...., type = "response") 时的预测值大约在 [-0.001 到 0.5] 之间。

如何在没有从 0 到 1 ([0,1]) 范围内的风险的情况下解释新样本的风险。

【问题讨论】:

    标签: r predict gbm


    【解决方案1】:

    如果您查看 bazehaz.gbm,您会发现 gbm.predict 给出了 lambda_0(t)。

    The proportional hazard model assumes h(t|x)=lambda(t)*exp(f(x)).
    gbm can estimate the f(x) component via partial likelihood.
    After estimating f(x), basehaz.gbm can compute the a nonparametric estimate of lambda(t).
    

    所以你可以这样(我希望):

    model = gbm(Surv(durata, status2015) ~ .-fold, data= ...)
    XB =predict.gbm(model, n.trees = ..., type = "response")
    
    lambda0 = basehaz.gbm(t = data$time, delta = data$censoring,  t.eval =   sort(unique(data$time)), cumulative = FALSE, f.x = XB , smooth=T)
    XBnew =predict.gbm(model, n.trees = ..., data=newData, type = "response")
    
    hazard = h(t|x)= lambda0*exp(XBnew).
    

    如果您正在寻找生存功能.. 我正在研究它。 :)

    P.S.:XB 思想的估计有一个奇怪的行为。因为它随着树的数量而显着变化。 :(

    【讨论】:

    • 我试过你的方法,为什么 XB 和 XBnew 是一样的,即使我使用不同的数据
    • 这个问题解决了吗?我对预测生存函数很感兴趣。谢谢!
    • 如果我将测试变量添加到对predict 的调用结果中,似乎我得到了一些有意义的东西(?)......即:X.pred <- X.test + predict(model, ..., type="response")。在我的测试用例中,我得到了很好的预测,我不确定它是否可疑......
    猜你喜欢
    • 2013-02-28
    • 2018-10-10
    • 2016-01-22
    • 2015-06-22
    • 1970-01-01
    • 2018-12-21
    • 1970-01-01
    • 1970-01-01
    • 2021-08-10
    相关资源
    最近更新 更多