Skip to contents

Constructs a learner class object for random survival forests

Usage

learner_surv_rf(
  formula,
  info = "survival forest (ranger)",
  num.threads = 1L,
  learner.args = NULL,
  ...
)

Arguments

formula

(formula) Formula specifying response and design matrix.

info

(character) Optional information to describe the instantiated learner object.

num.threads

Number of threads. Use 0 for all available cores. Default is 2 if not set by options/environment variables (see below).

learner.args

(list) Additional arguments to learner$new().

...

Further arguments passed to or from other methods (currently ignored).

Value

learner object.

Author

Klaus Kähler Holst

Examples

data(sTRACE, package="mets")
mod <- learner_surv_rf(Surv(time, status>0) ~ sex + age)
mod$estimate(sTRACE)
mod$predict(head(sTRACE), times=5) # P(T>t|X)
#> [1] 0.1707740 0.7428282 0.4698092 0.9109115 0.7899198 0.4944565