【发布时间】:2018-05-01 17:32:18
【问题描述】:
我正在尝试根据 R 中的 RANDOMFORESTSRC 插图执行随机森林生存分析。我有一个包含 59 个变量的数据框 - 其中 14 个是数字,其余是因子。其中 2 个数字是 TIME(距离死亡的天数)和 DIED(0/1 死亡与否)。我遇到了两个问题:
trainrfsrc<- rfsrc(Surv(TIME, DIED) ~ .,
data = train, nsplit = 10, na.action = "na.impute")
trainrfsrc 给出:错误率:17.07%
工作正常,但探索错误率,例如:
plot(gg_error(trainrfsrc))+ coord_cartesian(y = c(.09,.31))
返回:
geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic?
或:
a<-(gg_error(trainrfsrc))
a
error ntree 1 NA 1 2 NA 2 3 NA 3 4 NA 4 5 NA 5 6 NA 6 7 NA 7 8 NA 8 9 NA 9 10 NA 10
所有 1000 棵树都不适用。为什么每个尝试的树都没有错误率?
第二个问题是在尝试使用 VIMP 探索最重要的变量时,例如:
plot(gg_vimp(trainrfsrc)) + theme(legend.position = c(.8,.2))+ labs(fill = "VIMP > 0")
它返回:
In gg_vimp.rfsrc(trainrfsrc) : rfsrc object does not contain VIMP information. Calculating...
有什么想法吗?谢谢
【问题讨论】:
标签: random-forest survival-analysis