View source: R/BenchmarkResult.R
autoplot.BenchmarkResult | R Documentation |
Visualizations for mlr3::BenchmarkResult.
The argument type
controls what kind of plot is drawn.
Possible choices are:
"boxplot"
(default): Boxplots of performance measures, one box per mlr3::Learner and one facet per mlr3::Task.
"roc"
: ROC curve (1 - specificity on x, sensitivity on y).
The mlr3::BenchmarkResult may only have a single mlr3::Task and a single mlr3::Resampling.
Note that you can subset any mlr3::BenchmarkResult with its $filter()
method (see examples).
Requires package precrec.
"prc"
: Precision recall curve.
See "roc"
.
## S3 method for class 'BenchmarkResult'
autoplot(
object,
type = "boxplot",
measure = NULL,
theme = theme_minimal(),
...
)
object |
(mlr3::BenchmarkResult). |
type |
(character(1)): |
measure |
(mlr3::Measure) |
theme |
( |
... |
(ignored). |
ggplot2::ggplot()
.
Saito T, Rehmsmeier M (2017). “Precrec: fast and accurate precision-recall and ROC curve calculations in R.” Bioinformatics, 33(1), 145-147. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/bioinformatics/btw570")}.
if (requireNamespace("mlr3")) {
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))
autoplot(object)
autoplot(object$clone(deep = TRUE)$filter(task_ids = "pima"), type = "roc")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.