Learn R Programming

survcompare (version 0.2.0)

survsrfens_train: Fits an ensemble of Cox-PH and Survival Random Forest (SRF) with internal CV to tune SRF hyperparameters.

Description

Details: the function trains Cox model, then adds its out-of-the-box predictions to Survival Random Forest as an additional predictor to mimic stacking procedure used in Machine Learning and reduce over-fitting. #' Cox model is fitted to .9 data to predict the rest .1 for each 1/10s fold; these out-of-the-bag predictions are passed on to SRF

Usage

survsrfens_train(
  df_train,
  predict.factors,
  fixed_time = NaN,
  inner_cv = 3,
  randomseed = NaN,
  tuningparams = list(),
  useCoxLasso = FALSE,
  max_grid_size = 10,
  var_importance_calc = FALSE,
  verbose = FALSE
)

Value

trained object of class survsrf_ens

Arguments

df_train

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

predict.factors

list of predictor names

fixed_time

time at which performance is maximized

inner_cv

number of cross-validation folds for hyperparameters' tuning

randomseed

random seed to control tuning including data splits

tuningparams

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

useCoxLasso

if CoxLasso is used (TRUE) or not (FALSE, default)

max_grid_size

number of random grid searches for model tuning

var_importance_calc

if variable importance is computed

verbose

FALSE (default)/TRUE