plot.ceteris_paribus_oscillations: Plot Ceteris Paribus Oscillations

Description Usage Arguments Value Examples

View source: R/plot_ceteris_paribus_oscillations.R

Description

Function 'plot.ceteris_paribus_oscillations' plots variable importance plots.

Usage

1
2
## S3 method for class 'ceteris_paribus_oscillations'
plot(x, ...)

Arguments

x

a ceteris paribus oscillation explainer produced with function 'calculate_oscillations()'

...

other explainers that shall be plotted together

Value

a ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
library("DALEX")
 ## Not run: 
library("randomForest")
set.seed(59)

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

explainer_rf <- explain(apartments_rf_model,
      data = apartmentsTest, y = apartmentsTest$m2.price)

apartment <- apartmentsTest[1:2,]

cp_rf <- ceteris_paribus(explainer_rf, apartment)
plot(cp_rf, color = "_ids_")

vips <- calculate_oscillations(cp_rf)
vips
plot(vips)

## End(Not run)

ceterisParibus documentation built on March 31, 2020, 5:22 p.m.