Learn R Programming

ceterisParibus (version 0.4.2)

calculate_oscillations: Calculate Oscillations for Ceteris Paribus Explainer

Description

Calculate Oscillations for Ceteris Paribus Explainer

Usage

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

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,]

cp_rf <- ceteris_paribus(explainer_rf, apartment)
calculate_oscillations(cp_rf)
}

Run the code above in your browser using DataLab