Generates plots for mlr3::TaskClassif.

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

Arguments

object

(mlr3::TaskClassif).

type

(character(1)): Type of the plot. Available choices:

  • "target": bar plot of 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.

...

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

Value

ggplot2::ggplot() object.

Examples

library(mlr3) task = mlr_tasks$get("iris") head(fortify(task))
#> Species Petal.Length Petal.Width Sepal.Length Sepal.Width #> 1: setosa 1.4 0.2 5.1 3.5 #> 2: setosa 1.4 0.2 4.9 3.0 #> 3: setosa 1.3 0.2 4.7 3.2 #> 4: setosa 1.5 0.2 4.6 3.1 #> 5: setosa 1.4 0.2 5.0 3.6 #> 6: setosa 1.7 0.4 5.4 3.9
autoplot(task)
autoplot(task$clone()$select(c("Sepal.Length", "Sepal.Width")), type = "pairs")
#> Registered S3 method overwritten by 'GGally': #> method from #> +.gg ggplot2
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
autoplot(task, type = "duo")