plotHeat: plotHeat

Description Usage Arguments Examples

View source: R/plotHeat.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
plotHeat(
  dinteraction,
  plotly = FALSE,
  top = NULL,
  title = "",
  intPal = rev(sequential_hcl(palette = "Blues 3", n = 11)),
  impPal = rev(sequential_hcl(palette = "Reds 3", n = 11)),
  fitlimsInt = NULL,
  fitlimsImp = NULL,
  angle = NULL,
  ...
)

Arguments

plotly

If TRUE then an interactive plot is displayed.

top

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

title

Adds title to the plot.

intPal

A colorspace colour palette to display the interaction values.

impPal

A colorspace colour palette to display the importance values.

fitlimsInt

Specifies the fit range for the color map for interaction strength.

fitlimsImp

Specifies the fit range for the color map for importance.

angle

The angle to display the x-axis labels.

...

Not currently implemented.

mat

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

minInt

Minimum interaction strength to be displayed on the legend.

maxInt

Maximum interaction strength to be displayed on the legend.

minImp

Minimum importance value to be displayed on the legend.

maxImp

Maximum importance value to be displayed on the legend.

Examples

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

# Run an mlr ranger model:
library(mlr3)
library(mlr3learners)
library(ranger)
aq <- na.omit(airquality)
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 <- vividMatrix(task = aq_Task,  model = aq_Mod)

# Create plot:
plot(myMat, type = "heatMap")

AlanInglis/vividOld documentation built on March 4, 2021, 12:44 a.m.