autoplot.ResampleResult: Plot for ResampleResult

Description Usage Arguments Value References Examples

View source: R/ResampleResult.R

Description

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

Usage

1
2
## S3 method for class 'ResampleResult'
autoplot(object, type = "boxplot", measure = NULL, predict_sets = "test", ...)

Arguments

object

(mlr3::ResampleResult).

type

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

measure

(mlr3::Measure)
Performance measure to use.

predict_sets

(character())
Only for type set to "prediction". Which points should be shown in the plot? Can be a subset of ("train", "test") or empty.

...

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

Value

ggplot2::ggplot() object.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
library(mlr3)
library(mlr3viz)

task = tsk("sonar")
learner = lrn("classif.rpart", predict_type = "prob")
resampling = rsmp("cv")
object = resample(task, learner, resampling)

head(fortify(object))

# Default: boxplot
autoplot(object)

# Histogram
autoplot(object, type = "histogram", bins = 30)

# ROC curve, averaged over resampling folds:
autoplot(object, type = "roc")

# ROC curve of joint prediction object:
autoplot(object$prediction(), type = "roc")

# Precision Recall Curve
autoplot(object, type = "prc")

# Prediction Plot
task = tsk("iris")$select(c("Sepal.Length", "Sepal.Width"))
resampling = rsmp("cv", folds = 3)
object = resample(task, learner, resampling, store_models = TRUE)
autoplot(object, type = "prediction")

mlr-org/mlr3viz documentation built on Oct. 13, 2021, 11:43 p.m.