plotHeatMap: plotHeatMap

Description Usage Arguments Examples

View source: R/plotHeatMap.R

Description

Plots a Heatmap-tyle display showingVariable Importance and Variable Interaction

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
plotHeatMap(
  mat,
  plotly = FALSE,
  intLow = "floralwhite",
  intHigh = "dodgerblue4",
  impLow = "white",
  impHigh = "firebrick1",
  top = NULL,
  reorder = TRUE,
  minImp = 0,
  maxImp = NULL,
  minInt = 0,
  maxInt = NULL
)

Arguments

mat

A matrix of values to be plotted. Either added by the user or created using the prepFunc() function.

plotly

If TRUE then an interactive plot is displayed.

intLow

Colour, set by the user, to display low interaction strengths.

intHigh

Colour, set by the user, to display high interaction strengths.

impLow

Colour, set by the user, to display low importance values.

impHigh

Colour, set by the user, to display high importance values.

top

Returns the first part of the interaction matrix and resulting plot. Similar to head() function.

reorder

If TRUE (default) uses DendSer to reorder the matrix of interactions and variable importances

minImp

Minimum importance value to be displayed on the legend.

maxImp

Maximum importance value to be displayed on the legend.

minInt

Minimum interaction strength to be displayed on the legend.

maxInt

Maximum interaction strength to be displayed on the legend.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# 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 matrix
myMat <- prepFunc(task = aq_Task, learner = aq_lrn, model = aq_Mod)

# Create plot:
plotHeatMap(myMat)

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