survsrf_cv {survcompare}R Documentation

Cross-validates SRF model

Description

Cross-validates SRF model

Usage

survsrf_cv(
  df,
  predict.factors,
  fixed_time = NaN,
  outer_cv = 3,
  repeat_cv = 2,
  randomseed = NULL,
  return_models = FALSE,
  inner_cv = 3,
  srf_tuning = list(),
  oob = TRUE
)

Arguments

df

data frame with the data, "time" and "event" for survival outcome

predict.factors

list of predictor names

fixed_time

at which performance metrics are computed

outer_cv

k in k-fold CV, default 3

repeat_cv

if NULL, runs once, otherwise repeats CV

randomseed

random seed

return_models

TRUE/FALSE, if TRUE returns all CV objects

inner_cv

k in the inner loop of k-fold CV for SRF hyperparameters tuning, default is 3

srf_tuning

list of tuning parameters for random forest: 1) NULL for using a default tuning grid, or 2) a list("mtry"=c(...), "nodedepth" = c(...), "nodesize" = c(...))

oob

TRUE/FALSE use out-of-bag prediction accuracy while tuning instead of cross-validation, TRUE by default

Value

list of outputs

Examples



df <- simulate_nonlinear()
srf_cv <- survsrf_cv(df, names(df)[1:4])
summary(srf_cv)



[Package survcompare version 0.1.2 Index]