Learn R Programming

ceterisParibus (version 0.4.2)

plot.ceteris_paribus_oscillations: Plot Ceteris Paribus Oscillations

Description

Function 'plot.ceteris_paribus_oscillations' plots variable importance plots.

Usage

# S3 method for ceteris_paribus_oscillations
plot(x, ...)

Value

a ggplot2 object

Arguments

x

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

...

other explainers that shall be plotted together

Examples

Run this code
library("DALEX")
 if (FALSE) {
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