plot.global_importance: Plot Global Variable Importance measure

Description Usage Arguments Value Examples

View source: R/plot_global_importance.R

Description

Function plot.global_importance plots global importance measure based on Partial Dependence profiles.

Usage

1
2
## S3 method for class 'global_importance'
plot(x, ..., variables = NULL, type = NULL, title = "Variable importance")

Arguments

x

object returned from global_variable_importance() function

...

other object returned from global_variable_importance() function that shall be plotted together

variables

if not NULL then only variables will be presented

type

a character. How variables shall be plotted? Either "bars" (default) or "lines".

title

the plot's title, by default 'Variable importance'

Value

a ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library("DALEX")
data(apartments)

library("randomForest")
apartments_rf_model <- randomForest(m2.price ~ construction.year + surface +
                                    floor + no.rooms, data = apartments)

explainer_rf <- explain(apartments_rf_model, data = apartmentsTest[,2:5],
                        y = apartmentsTest$m2.price)

profiles <- model_profile(explainer_rf)

library("vivo")
measure <- global_variable_importance(profiles)

plot(measure)

vivo documentation built on Sept. 7, 2020, 5:09 p.m.