interactionPlot: interactionPlot

Description Usage Arguments Examples

View source: R/barplotInteraction.R

Description

Plots a selected variable against all other variables in a model

Usage

1
interactionPlot(task, model, type = "lollipop")

Arguments

task

Task created from the mlr package, either regression or classification.

model

Any machine learning model.

type

The type of plot to display, either "lollipop" (default), "barplot", or "circleBar"

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Load in the data:
aq <- data.frame(airquality)
aq <- na.omit(aq)

# Run an mlr ranger model:
library(mlr3)
library(mlr3learners)
library(ranger)
aq_Task = TaskRegr$new(id = "airQ", backend = aq, target = "Ozone")
aq_lrn = lrn("regr.ranger", importance = "permutation")
aq_Mod <- aq_lrn$train(aq_Task)

# Create plot:
interactionPlot(aq_Task, aq_Mod)

AlanInglis/vivid documentation built on July 9, 2020, 1:53 a.m.