autoplot.PredictionSurv: Plot for PredictionSurv

Description Usage Arguments References Examples

View source: R/PredictionSurv.R

Description

Generates plots for mlr3proba::PredictionSurv, depending on argument type:

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## S3 method for class 'PredictionSurv'
autoplot(
  object,
  type = c("calib", "dcalib"),
  task = NULL,
  row_ids = NULL,
  times = NULL,
  xyline = TRUE,
  cuts = 11L,
  ...
)

Arguments

object

(mlr3proba::PredictionSurv).

type

(character(1)):
Type of the plot. See description.

task

(mlr3proba::TaskSurv)
If type = "calib" then task is passed to $predict in the Kaplan-Meier learner.

row_ids

(integer())
If type = "calib" then row_ids is passed to $predict in the Kaplan-Meier learner.

times

(numeric())
If type = "calib" then times is the values on the x-axis to plot over, if NULL uses all times from task.

xyline

(logical(1))
If TRUE (default) plots the x-y line for type = "dcalib".

cuts

(integer(1))
Number of cuts in (0,1) to plot dcalib over, default is 11.

...

(any): Additional arguments, currently unused.

References

Haider H, Hoehn B, Davis S, Greiner R (2020). “Effective Ways to Build and Evaluate Individual Survival Distributions.” Journal of Machine Learning Research, 21(85), 1-63. https://jmlr.org/papers/v21/18-772.html.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(mlr3)
library(mlr3proba)
library(mlr3viz)

learn = lrn("surv.coxph")
task = tsk("unemployment")
p = learn$train(task, row_ids = 1:300)$predict(task, row_ids = 301:400)

# calibration by comparison of average prediction to Kaplan-Meier
autoplot(p, type = "calib", task = task, row_ids = 301:400)

# Distribution-calibration (D-Calibration)
autoplot(p, type = "dcalib")

mlr3viz documentation built on July 2, 2021, 1:07 a.m.