Learn R Programming

mlr3viz (version 0.5.8)

autoplot.TaskClassif: Plot for Classification Tasks

Description

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

  • "target" (default): Bar plot of the target variable (default).

  • "duo": Passes data and additional arguments down to GGally::ggduo(). columnsX is target, columnsY is features.

  • "pairs": Passes data and additional arguments down to GGally::ggpairs(). Color is set to target column.

Usage

# S3 method for TaskClassif
autoplot(object, type = "target", ...)

Arguments

type

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

...

(any): Additional argument, possibly passed down to the underlying plot functions.

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

Examples

Run this code
# NOT RUN {
library(mlr3)
library(mlr3viz)

task = tsk("iris")

head(fortify(task))
autoplot(task)
autoplot(task$clone()$select(c("Sepal.Length", "Sepal.Width")),
  type = "pairs")
autoplot(task, type = "duo")
# }

Run the code above in your browser using DataLab