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

  • "boxplot" (default): Boxplot of performance measures.

  • "histogram": Histogram of performance measures.

  • "roc": ROC curve (1 - specificity on x, sensitivity on y). The predictions of the individual mlr3::Resamplings are merged prior to calculating the ROC curve (micro averaged). Requires package precrec.

  • "prc": Precision recall curve. See "roc".

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

Arguments

object

(mlr3::ResampleResult).

type

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

measure

(mlr3::Measure).

...

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

Value

ggplot2::ggplot() object.

Examples

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))
#> iteration measure_id performance #> 1: 1 classif.ce 0.4285714 #> 2: 2 classif.ce 0.1904762 #> 3: 3 classif.ce 0.2380952 #> 4: 4 classif.ce 0.3333333 #> 5: 5 classif.ce 0.3333333 #> 6: 6 classif.ce 0.3333333
# 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")