plot.ceteris_paribus_oscillations {ceterisParibus}R Documentation

Plot Ceteris Paribus Oscillations

Description

Function 'plot.ceteris_paribus_oscillations' plots variable importance plots.

Usage

## 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

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)

[Package ceterisParibus version 0.4.2 Index]