autoplot.LearnerSurvCoxPH: Plots for Cox Proportional Hazards Learner

View source: R/LearnerSurvCoxPH.R

autoplot.LearnerSurvCoxPHR Documentation

Plots for Cox Proportional Hazards Learner

Description

Visualizations for mlr3proba::LearnerSurvCoxPH.

The argument type controls what kind of plot is drawn. The only possible choice right now is "ggforest" (default) which is a Forest Plot, using ggforest. This plot displays the estimated hazard ratios (HRs) and their confidence intervals (CIs) for different variables included in the (trained) model.

Usage

## S3 method for class 'LearnerSurvCoxPH'
autoplot(object, type = "ggforest", ...)

Arguments

object

(mlr3proba::LearnerSurvCoxPH).

type

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

...

Additional parameters passed down to ggforest.

Value

ggplot2::ggplot().

Examples


if (requireNamespace("mlr3proba")) {
  library(mlr3proba)
  library(mlr3viz)

  task = tsk("lung")
  learner = lrn("surv.coxph")
  learner$train(task)
  autoplot(learner)
}


mlr-org/mlr3viz documentation built on Jan. 17, 2025, 3:37 a.m.