importancePlot: importancePlot

Description Usage Arguments Examples

View source: R/barplotImportance.R

Description

Plots variable importance

Usage

1
importancePlot(mat, type = "lollipop", minImp = 0, maxImp = NULL, ...)

Arguments

mat

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

type

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

minImp

Minimum importance value to be displayed on the legend.

maxImp

Maximum importance value to be displayed on the legend.

...

Not currently implemented

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_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:
importancePlot(myMat)

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