Calculate Oscillations for Ceteris Paribus Explainer

calculate_oscillations(x, sort = TRUE, ...)

Arguments

x

a ceteris_paribus explainer produced with the `ceteris_paribus()` function

sort

a logical value. If TRUE then rows are sorted along the oscillations

...

other arguments

Examples

library("DALEX")
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,] cp_rf <- ceteris_paribus(explainer_rf, apartment) calculate_oscillations(cp_rf)
#> _vname_ _ids_ oscillations #> 6 district 1001 1103.42482 #> 3 surface 1001 290.57755 #> 4 floor 1001 243.03520 #> 5 no.rooms 1001 143.53000 #> 2 construction.year 1001 52.17142 #> 1 m2.price 1001 0.00000