A mlr3::TaskGenerator calling simsurv::simsurv() from package simsurv.

This generator currently only exposes a small subset of the flexibility of simsurv, and just creates a small data set with the following numerical covariates:

  • treatment: Bernoulli distributed with log hazard ratio -0.5.

  • height: Normally distributed with log hazard ratio 1.

  • weight: normally distributed with log hazard ratio 0.

See simsurv::simsurv() for an explanation of the hyperparameters.

Format

R6::R6Class inheriting from mlr3::TaskGenerator.

Construction

TaskGeneratorSimsurv$new()
mlr_task_generators$get("simsurv")
tgen("simsurv")

See also

Examples

generator = mlr3::mlr_task_generators$get("simsurv") task = generator$generate(20) task$head()
#> eventtime status height treatment weight #> 1: 4.291922 1 195.4259 0 82.09298 #> 2: 5.000000 0 183.6958 0 71.43015 #> 3: 5.000000 0 169.1511 0 69.85071 #> 4: 5.000000 0 170.6989 0 79.55454 #> 5: 4.251872 1 173.9966 0 76.92144 #> 6: 1.018092 1 158.1131 1 75.14025