Learn R Programming

mlr3proba (version 0.4.9)

plot.LearnerSurv: Visualization of fitted LearnerSurv objects

Description

Wrapper around predict.LearnerSurv and plot.Matdist.

Usage

# S3 method for LearnerSurv
plot(
  x,
  task,
  fun = c("survival", "pdf", "cdf", "quantile", "hazard", "cumhazard"),
  row_ids = NULL,
  newdata,
  ...
)

Arguments

task
fun

(character) Passed to distr6::plot.Matdist

row_ids

(integer()) Passed to Learner$predict

newdata

(data.frame()) If not missing Learner$predict_newdata is called instead of Learner$predict.

...

Additional arguments passed to distr6::plot.Matdist

Examples

Run this code
# NOT RUN {
library(mlr3)
task = tsk("rats")

# Prediction Error Curves for prediction object
learn = lrn("surv.coxph")
learn$train(task)

plot(learn, task, "survival", ind = 10)
plot(learn, task, "survival", row_ids = 1:5)
plot(learn, task, "survival", newdata = task$data()[1:5, ])
plot(learn, task, "survival", newdata = task$data()[1:5, ], ylim = c(0, 1))
# }

Run the code above in your browser using DataLab