Skip to contents

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

Usage

# S3 method for TaskSurv
autoplot(object, type = "target", ...)

Arguments

object

(mlr3proba::TaskSurv).

type

(character(1)):
Type of the plot. Available choices:

...

(any): Additional arguments. rhs is passed down to $formula of mlr3proba::TaskSurv for stratification for type "target". Other arguments are passed to the respective underlying plot functions.

Value

ggplot2::ggplot() object.

Theme

The theme_mlr3() and viridis color maps are applied by default to all autoplot() methods. To change this behavior set options(mlr3.theme = FALSE).

Examples

library(mlr3)
library(mlr3viz)
library(mlr3proba)

task = tsk("lung")

head(fortify(task))
#>    time status age inst meal.cal pat.karno ph.ecog ph.karno sex wt.loss
#> 1:  306   TRUE  74    3     1175       100       1       90   m      NA
#> 2:  455   TRUE  68    3     1225        90       0       90   m      15
#> 3: 1010  FALSE  56    3       NA        90       0       90   m      15
#> 4:  210   TRUE  57    5     1150        60       1       90   m      11
#> 5:  883   TRUE  60    1       NA        90       0      100   m       0
#> 6: 1022  FALSE  74   12      513        80       1       50   m       0
autoplot(task)

autoplot(task, rhs = "sex")
#> Scale for 'colour' is already present. Adding another scale for 'colour',
#> which will replace the existing scale.

autoplot(task, type = "duo")
#> Warning: Removed 1 rows containing non-finite values (stat_smooth).
#> Warning: Removed 1 rows containing missing values (geom_point).
#> Warning: Removed 1 rows containing non-finite values (stat_boxplot).
#> Warning: Removed 47 rows containing non-finite values (stat_smooth).
#> Warning: Removed 47 rows containing missing values (geom_point).
#> Warning: Removed 47 rows containing non-finite values (stat_boxplot).
#> Warning: Removed 3 rows containing non-finite values (stat_smooth).
#> Warning: Removed 3 rows containing missing values (geom_point).
#> Warning: Removed 3 rows containing non-finite values (stat_boxplot).
#> Warning: Removed 1 rows containing non-finite values (stat_smooth).
#> Warning: Removed 1 rows containing missing values (geom_point).
#> Warning: Removed 1 rows containing non-finite values (stat_boxplot).
#> Warning: Removed 1 rows containing non-finite values (stat_smooth).
#> Warning: Removed 1 rows containing missing values (geom_point).
#> Warning: Removed 1 rows containing non-finite values (stat_boxplot).
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> Warning: Removed 14 rows containing non-finite values (stat_smooth).
#> Warning: Removed 14 rows containing missing values (geom_point).
#> Warning: Removed 14 rows containing non-finite values (stat_boxplot).