Skip to contents

Non-parametric estimator of the cumulative hazard rate function. Calls survival::survfit() from survival.

Prediction types

This learner returns two prediction types:

  1. distr: a survival matrix in two dimensions, where observations are represented in rows and time points in columns. The cumulative hazard \(H(t)\) is calculated using the train data and the default parameters of the survival::survfit() function, i.e. ctype = 1, which uses the Nelson-Aalen formula. Then for each test observation the survival curve is \(S(t) = \exp{(-H(t))}\).

  2. crank: the expected mortality using mlr3proba::.surv_return().

Dictionary

This Learner can be instantiated via lrn():

lrn("surv.nelson")

Meta Information

  • Task type: “surv”

  • Predict Types: “crank”, “distr”

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

  • Required Packages: mlr3, mlr3proba, mlr3extralearners, survival, pracma

Parameters

Empty ParamSet

References

Nelson, Wayne (1969). “Hazard plotting for incomplete failure data.” Journal of Quality Technology, 1(1), 27–52.

Nelson, Wayne (1972). “Theory and applications of hazard plotting for censored failure data.” Technometrics, 14(4), 945–966.

Aalen, Odd (1978). “Nonparametric inference for a family of counting processes.” The Annals of Statistics, 701–726.

See also

Author

RaphaelS1

Super classes

mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvNelson

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

LearnerSurvNelson$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner
learner = mlr3::lrn("surv.nelson")
print(learner)
#> <LearnerSurvNelson:surv.nelson>: Nelson-Aalen Estimator
#> * Model: -
#> * Parameters: list()
#> * Packages: mlr3, mlr3proba, mlr3extralearners, survival, pracma
#> * Predict Types:  [crank], distr
#> * Feature Types: logical, integer, numeric, character, factor, ordered
#> * Properties: missings

# Define a Task
task = mlr3::tsk("grace")

# Create train and test set
ids = mlr3::partition(task)

# Train the learner on the training ids
learner$train(task, row_ids = ids$train)

print(learner$model)
#> Call: survfit(formula = task$formula(1), data = task$data())
#> 
#>        n events median 0.95LCL 0.95UCL
#> [1,] 670    219     NA      NA      NA


# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)

# Score the predictions
predictions$score()
#> surv.cindex 
#>         0.5