【发布时间】:2017-03-18 05:52:33
【问题描述】:
我在 r 中使用 gbm 来预测生存率(分布 =“coxph”)。
gbm.predict(...., type = "response") 时的预测值大约在 [-0.001 到 0.5] 之间。
如何在没有从 0 到 1 ([0,1]) 范围内的风险的情况下解释新样本的风险。
【问题讨论】:
我在 r 中使用 gbm 来预测生存率(分布 =“coxph”)。
gbm.predict(...., type = "response") 时的预测值大约在 [-0.001 到 0.5] 之间。
如何在没有从 0 到 1 ([0,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 思想的估计有一个奇怪的行为。因为它随着树的数量而显着变化。 :(
【讨论】:
predict 的调用结果中,似乎我得到了一些有意义的东西(?)......即:X.pred <- X.test + predict(model, ..., type="response")。在我的测试用例中,我得到了很好的预测,我不确定它是否可疑......