Is there a way to use caret for survival analysis. I really like how easy it is to use. I tried to set a random survival forest using the party package, which is on the carriage list.
It works:
library(survival) library(caret) library(party) fitcforest <- cforest(Surv(futime, death) ~ sex+age, data=flchain, controls = cforest_classical(ntree = 1000))
but using caret , I get an error:
fitControl <- trainControl(## 10-fold CV method = "repeatedcv", number = 10, repeats = 2, ) cforestfit <- train(Surv(futime, death) ~ sex+age,data=flchain, method="cforest",trControl = fitControl)
I get this error:
Error: nrow(x) == length(y) is not TRUE
Is there any way to get these Surv objects Surv work with the carriage? Can I use other survival-oriented carriage packages?
thanks
source share