autoplot.PredictionClassif {mlr3viz}R Documentation

Plots for Classification Predictions

Description

Visualizations for mlr3::PredictionClassif. The argument type controls what kind of plot is drawn. Possible choices are:

Usage

## S3 method for class 'PredictionClassif'
autoplot(
  object,
  type = "stacked",
  measure = NULL,
  theme = theme_minimal(),
  ...
)

Arguments

object

(mlr3::PredictionClassif).

type

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

measure

(mlr3::Measure)
Performance measure to use.

theme

(ggplot2::theme())
The ggplot2::theme_minimal() is applied by default to all plots.

...

(ignored).

Value

ggplot2::ggplot().

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


if (requireNamespace("mlr3")) {
  library(mlr3)
  library(mlr3viz)

  task = tsk("spam")
  learner = lrn("classif.rpart", predict_type = "prob")
  object = learner$train(task)$predict(task)

  head(fortify(object))
  autoplot(object)
  autoplot(object, type = "roc")
  autoplot(object, type = "prc")
}


[Package mlr3viz version 0.9.0 Index]