autoplot.TaskClassif: Plot for Classification Tasks

View source: R/TaskClassif.R

autoplot.TaskClassifR Documentation

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 class 'TaskClassif'
autoplot(object, type = "target", ...)

Arguments

object

(mlr3::TaskClassif).

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

if (requireNamespace("mlr3")) {
  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")
}

mlr-org/mlr3viz documentation built on Nov. 24, 2022, 3:47 p.m.