2016-11-04 102 views
1

我在r中使用gbm来预测生存(distribution =“coxph”)。GBM in r for coxph loss function

gbm.predict(....,type =“response”)的预测值大概在[-0.001至0.5]之间。

如何解释新样本的风险范围为0到1([0,1])。

回答

0

如果你看看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思想的估计中有一种奇怪的行为,因为它随着树的数量而显着变化。 :(

+0

我试过你的方法,为什么XB和XBnew是相同的,即使我使用不同的数据 – BigDataScientist