Skip to contents

Generates plots for mlr3::BenchmarkResult, depending on argument type:

Usage

# S3 method for BenchmarkResult
autoplot(object, type = "boxplot", measure = NULL, ...)

Arguments

object

(mlr3::BenchmarkResult).

type

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

measure

(mlr3::Measure)
Performance measure to use.

...

(any): Additional arguments, passed down to the respective geom or plotting function.

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).

References

Saito T, Rehmsmeier M (2017). “Precrec: fast and accurate precision-recall and ROC curve calculations in R.” Bioinformatics, 33(1), 145-147. doi: 10.1093/bioinformatics/btw570 .

Examples

library(mlr3)
library(mlr3viz)

tasks = tsks(c("pima", "sonar"))
learner = lrns(c("classif.featureless", "classif.rpart"),
  predict_type = "prob")
resampling = rsmps("cv")
object = benchmark(benchmark_grid(tasks, learner, resampling))

head(fortify(object))
#>    nr task_id          learner_id resampling_id classif.ce
#> 1:  1    pima classif.featureless            cv  0.3636364
#> 2:  1    pima classif.featureless            cv  0.2987013
#> 3:  1    pima classif.featureless            cv  0.2727273
#> 4:  1    pima classif.featureless            cv  0.4155844
#> 5:  1    pima classif.featureless            cv  0.3506494
#> 6:  1    pima classif.featureless            cv  0.2987013
autoplot(object)

autoplot(object$clone(deep = TRUE)$filter(task_ids = "pima"), type = "roc")