Learn R Programming

survcompare (version 0.2.0)

survsrf_cv: Cross-validates Survival Random Forest

Description

Cross-validates Survival Random Forest

Usage

survsrf_cv(
  df,
  predict.factors,
  fixed_time = NaN,
  outer_cv = 3,
  inner_cv = 3,
  repeat_cv = 2,
  randomseed = NaN,
  return_models = FALSE,
  tuningparams = list(),
  max_grid_size = 10,
  verbose = FALSE,
  suppresswarn = TRUE
)

Value

list of outputs

Arguments

df

data, "time" and "event" should describe survival outcome

predict.factors

list of predictor names

fixed_time

time at which performance is maximized

outer_cv

number of cross-validation folds for model validation

inner_cv

number of cross-validation folds for hyperparameters' tuning

repeat_cv

number of CV repeats, if NaN, runs once

randomseed

random seed to control tuning including data splits

return_models

if all models are stored and returned

tuningparams

if given, list of hyperparameters, list(mtry=c(), nodedepth=c(),nodesize=c()), otherwise a wide default grid is used

max_grid_size

number of random grid searches for model tuning

verbose

FALSE(default)/TRUE

suppresswarn

TRUE/FALSE, TRUE by default

Examples

Run this code
# \donttest{
rfcores_old<- options()$rf.cores; options(rf.cores = 1)
df <- simulate_nonlinear()
srf_cv <- survsrf_cv(df, names(df)[1:4])
summary(srf_cv)
options(rf.cores=rfcores_old)
# }

Run the code above in your browser using DataLab