This Learner specializes Learner for survival problems:

  • task_type is set to "surv"

  • Creates Predictions of class PredictionSurv.

  • Possible values for predict_types are:

    • "distr": Predicts a probability distribution for each observation in the test set, uses distr6.

    • "lp": Predicts a linear predictor for each observation in the test set.

    • "crank": Predicts a continuous ranking for each observation in the test set.

    • "response": Predicts a survival time for each observation in the test set.

See also

Other Learner: LearnerDens

Super class

mlr3::Learner -> LearnerSurv

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage

LearnerSurv$new(
  id,
  param_set = ParamSet$new(),
  predict_types = "distr",
  feature_types = character(),
  properties = character(),
  packages = character()
)

Arguments

id

(character(1))
Identifier for the new instance.

param_set

(paradox::ParamSet)
Set of hyperparameters.

predict_types

(character())
Supported predict types. Must be a subset of mlr_reflections$learner_predict_types.

feature_types

(character())
Feature types the learner operates on. Must be a subset of mlr_reflections$task_feature_types.

properties

(character())
Set of properties of the Learner. Must be a subset of mlr_reflections$learner_properties. The following properties are currently standardized and understood by learners in mlr3:

  • "missings": The learner can handle missing values in the data.

  • "weights": The learner supports observation weights.

  • "importance": The learner supports extraction of importance scores, i.e. comes with an $importance() extractor function (see section on optional extractors in Learner).

  • "selected_features": The learner supports extraction of the set of selected features, i.e. comes with a $selected_features() extractor function (see section on optional extractors in Learner).

  • "oob_error": The learner supports extraction of estimated out of bag error, i.e. comes with a oob_error() extractor function (see section on optional extractors in Learner).

packages

(character())
Set of required packages. A warning is signaled by the constructor if at least one of the packages is not installed, but loaded (not attached) later on-demand via requireNamespace().


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerSurv$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

library(mlr3) # get all survival learners from mlr_learners: lrns = mlr_learners$mget(mlr_learners$keys("^surv")) names(lrns)
#> [1] "surv.blackboost" "surv.coxph" "surv.cvglmnet" #> [4] "surv.flexible" "surv.gamboost" "surv.gbm" #> [7] "surv.glmboost" "surv.glmnet" "surv.kaplan" #> [10] "surv.mboost" "surv.nelson" "surv.obliqueRSF" #> [13] "surv.parametric" "surv.penalized" "surv.randomForestSRC" #> [16] "surv.ranger" "surv.rpart" "surv.svm"
# get a specific learner from mlr_learners: mlr_learners$get("surv.coxph")
#> <LearnerSurvCoxPH:surv.coxph> #> * Model: - #> * Parameters: list() #> * Packages: survival, distr6 #> * Predict Type: distr #> * Feature types: logical, integer, numeric, factor #> * Properties: importance
lrn("surv.coxph")
#> <LearnerSurvCoxPH:surv.coxph> #> * Model: - #> * Parameters: list() #> * Packages: survival, distr6 #> * Predict Type: distr #> * Feature types: logical, integer, numeric, factor #> * Properties: importance