【发布时间】:2018-12-05 07:37:40
【问题描述】:
我正在尝试使用 R 包方中的 cforest 函数来分析一些右删失的生存数据。每次我使用 predict 函数时,我都会得到每个值的 Inf,这意味着无法生成一致性索引。
我的数据可以在这里下载:https://www.dropbox.com/s/nt9s3p1rdafq465/test_data.csv?dl=0
例子:
library(party)
library(survival)
mydata <- read.csv(file="test_data.csv", header=TRUE, sep=",",row.names=NULL)
train<-head(mydata, n=800)
test<-tail(mydata, n=37)
cif_result <- cforest(Surv(timeToEvent, status) ~ V1 + V2 + V3 + V4 + V5 + V6,
data = train,
control=cforest_classical())
cforest_pred <- predict(object = cif_result, newdata = test)
cforest_pred
837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873
Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf Inf
我做错了吗?为什么 cforest 只根据这些数据预测 Inf?
【问题讨论】:
标签: r random-forest party