print.ceteris_paribus_profile: Print Ceteris Paribus Profiles

Description Usage Arguments Examples

View source: R/print_profile.R

Description

Print Ceteris Paribus Profiles

Usage

1
2
## S3 method for class 'ceteris_paribus_profile'
print(x, ...)

Arguments

x

a ceteris paribus profile produced with the 'calculate_profiles' function

...

other arguments that will be passed to head()

Examples

 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)

ceterisParibus documentation built on March 31, 2020, 5:22 p.m.