ingredients (version 0.3.1)

plot.ceteris_paribus_oscillations: Plot Ceteris Paribus Oscillations

Description

Function 'plot.ceteris_paribus_oscillations' plots local variable importance plots calculated as oscillations in the Ceteris Paribus Profiles.

Usage

# S3 method for ceteris_paribus_oscillations
plot(x, ..., bar_width = 10)

Arguments

x

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

...

other explainers that shall be plotted together

bar_width

width of bars. By default 10

Value

a ggplot2 object

References

Predictive Models: Visual Exploration, Explanation and Debugging https://pbiecek.github.io/PM_VEE

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab