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

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

mlr3viz documentation built on May 25, 2022, 5:06 p.m.