Description Usage Arguments Examples
View source: R/print_profile.R
Print Ceteris Paribus Profiles
1 2 |
x |
a ceteris paribus profile produced with the 'calculate_profiles' function |
... |
other arguments that will be passed to head() |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | library("DALEX")
## Not run:
library("randomForest")
set.seed(59)
apartments_rf_model <- randomForest(m2.price ~ construction.year + surface + floor +
no.rooms + district, data = apartments)
vars <- c("construction.year", "surface", "floor", "no.rooms", "district")
variable_splits <- calculate_variable_splits(apartments, vars)
new_apartment <- apartmentsTest[1:10, ]
profiles <- calculate_profiles(new_apartment, variable_splits,
apartments_rf_model)
profiles
# only subset of observations
small_apartments <- select_sample(apartmentsTest, n = 10)
small_apartments
small_profiles <- calculate_profiles(small_apartments, variable_splits,
apartments_rf_model)
small_profiles
# neighbors for a selected observation
new_apartment <- apartments[1, 2:6]
small_apartments <- select_neighbours(apartmentsTest, new_apartment, n = 10)
small_apartments
small_profiles <- calculate_profiles(small_apartments, variable_splits,
apartments_rf_model)
new_apartment
small_profiles
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.