autoplot.Filter: Plot for Filter Scores

View source: R/Filter.R

autoplot.FilterR Documentation

Plot for Filter Scores

Description

Generates plots for mlr3filters::Filter, depending on argument type:

  • "barplot" (default): Bar plot of filter scores.

Usage

## S3 method for class 'Filter'
autoplot(object, type = "boxplot", n = Inf, ...)

Arguments

object

(mlr3filters::Filter).

type

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

n

(integer(1))
Only include the first n features with highest importance. Defaults to all features.

...

(any): Additional argument, passed down to the respective geom.

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)
  library(mlr3filters)

  task = tsk("mtcars")
  f = flt("correlation")
  f$calculate(task)

  head(fortify(f))
  autoplot(f, n = 5)
}

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