Skip to contents

Calls flexsurv::flexsurvspline from package flexsurv.

Details

The distr prediction is estimated using the fitted custom distributions from flexsurv::flexsurvspline() and the estimated coefficients however the prediction takes place in this package and not in flexsurv for a much faster and more efficient implementation.

As flexible spline models estimate the baseline hazard as the intercept, the linear predictor, lp, can be calculated as in the classical setting. i.e. For fitted coefficients, \(\beta = (\beta_0,...,\beta_P)\), and covariates \(X^T = (X_0,...,X_P)^T\), where \(X_0\) is a column of \(1\)s: \(lp = \beta X\).

Dictionary

This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn():

mlr_learners$get("surv.flexible")
lrn("surv.flexible")

Meta Information

  • Task type: “surv”

  • Predict Types: “distr”, “crank”, “lp”

  • Feature Types: “logical”, “integer”, “factor”, “numeric”

  • Required Packages: mlr3extralearners, flexsurv, pracma

Parameters

IdTypeDefaultLevelsRange
bhazardlist-\((-\infty, \infty)\)
kinteger0\([0, \infty)\)
knotslist-\((-\infty, \infty)\)
bknotslist-\((-\infty, \infty)\)
scalecharacterhazardhazard, odds, normal\((-\infty, \infty)\)
timescalecharacterloglog, identity\((-\infty, \infty)\)
initslist-\((-\infty, \infty)\)
rtrunclist-\((-\infty, \infty)\)
fixedparslist-\((-\infty, \infty)\)
clnumeric0.95\([0, 1]\)
maxiterinteger30\((-\infty, \infty)\)
rel.tolerancenumeric1e-09\((-\infty, \infty)\)
toler.cholnumeric1e-10\((-\infty, \infty)\)
debuginteger0\([0, 1]\)
outer.maxinteger10\((-\infty, \infty)\)

Custom mlr3 defaults

  • k:

    • Actual default: 0

    • Adjusted default: 1

    • Reason for change: The default value of 0 is equivalent to, and a much less efficient implementation of, LearnerSurvParametric.

References

Royston P, Parmar MKB (2002). “Flexible parametric proportional-hazards and proportional-odds models for censored survival data, with application to prognostic modelling and estimation of treatment effects.” Statistics in Medicine, 21(15), 2175–2197. doi: 10.1002/sim.1203.

See also

Author

RaphaelS1

Super classes

mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvFlexible

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerSurvFlexible$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (requireNamespace("flexsurv", quietly = TRUE) && requireNamespace("pracma", quietly = TRUE)) {
  learner = mlr3::lrn("surv.flexible")
  print(learner)

  # available parameters:
  learner$param_set$ids()
}
#> <LearnerSurvFlexible:surv.flexible>
#> * Model: -
#> * Parameters: k=1
#> * Packages: mlr3, mlr3extralearners, flexsurv, pracma
#> * Predict Type: distr
#> * Feature types: logical, integer, factor, numeric
#> * Properties: weights
#>  [1] "bhazard"       "k"             "knots"         "bknots"       
#>  [5] "scale"         "timescale"     "inits"         "rtrunc"       
#>  [9] "fixedpars"     "cl"            "maxiter"       "rel.tolerance"
#> [13] "toler.chol"    "debug"         "outer.max"