Fits randomForestSRC, with tuning by mtry, nodedepth, and nodesize. Underlying model is by Ishwaran et al(2008) https://www.randomforestsrc.org/articles/survival.html Ishwaran H, Kogalur UB, Blackstone EH, Lauer MS. Random survival forests. The Annals of Applied Statistics. 2008;2:841–60.
survsrf_train(
df_train,
predict.factors,
fixed_time = NaN,
tuningparams = list(),
max_grid_size = 10,
inner_cv = 3,
randomseed = NaN,
verbose = TRUE
)
output = list(bestparams, allstats, model)
data, "time" and "event" should describe survival outcome
list of predictor names
time at which performance is maximized
if given, list of hyperparameters, list(mtry=c(), nodedepth=c(),nodesize=c()), otherwise a wide default grid is used
number of random grid searches for model tuning
number of cross-validation folds for hyperparameters' tuning
random seed to control tuning including data splits
TRUE/FALSE, FALSE by default
d <-simulate_nonlinear(100)
p<- names(d)[1:4]
tuningparams = list(
"mtry" = c(5,10,15),
"nodedepth" = c(5,10,15,20),
"nodesize" = c(20,30,50)
)
m_srf<- survsrf_train(d,p,tuningparams=tuningparams)
Run the code above in your browser using DataLab