print.aspect_importance: Function for printing aspect_importance results

Description Usage Arguments Examples

View source: R/aspect_importance.R

Description

This function prints the results of aspect_importance.

Usage

1
2
## S3 method for class 'aspect_importance'
print(x, show_features = FALSE, show_corr = FALSE, ...)

Arguments

x

object of aspect_importance class

show_features

show list of features for every aspect

show_corr

show if all features in aspect are pairwise positively correlated (for numeric features only)

...

other parameters

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
library("DALEX")

model_titanic_glm <- glm(survived == 1 ~
                         class+gender+age+sibsp+parch+fare+embarked,
                         data = titanic_imputed,
                         family = "binomial")

explain_titanic_glm <- explain(model_titanic_glm,
                               data = titanic_imputed[,-8],
                               y = titanic_imputed$survived == 1,
                               verbose = FALSE)

aspects <- list(wealth = c("class", "fare"),
                family = c("sibsp", "parch"),
                personal = c("gender", "age"),
                embarked = "embarked")

titanic_ai <- predict_aspects(explain_titanic_glm,
                  new_observation = titanic_imputed[1,],
                  variable_groups = aspects)
print(titanic_ai)

triplot documentation built on July 13, 2020, 5:08 p.m.