# \donttest{
library("DALEX")
library("ranger")
apartments_rf_model <- ranger(m2.price ~., data = apartments)
explainer_rf <- explain(apartments_rf_model,
data = apartments_test[,-1],
y = apartments_test[,1],
label = "ranger forest",
verbose = FALSE)
apartment <- apartments_test[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