plot.predict_diagnostics: Plot Instance Level Residual Diagnostics

Description Usage Arguments Value Examples

View source: R/plot_predict_diagnostics.R

Description

Plot Instance Level Residual Diagnostics

Usage

1
2
## S3 method for class 'predict_diagnostics'
plot(x, ...)

Arguments

x

an object with instance level residual diagnostics created with predict_diagnostics function

...

other parameters

Value

an ggplot2 object of the class gg.

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
library("ranger")
titanic_glm_model <- ranger(survived ~ gender + age + class + fare + sibsp + parch,
                     data = titanic_imputed)
explainer_glm <- explain(titanic_glm_model,
                         data = titanic_imputed,
                         y = titanic_imputed$survived)
johny_d <- titanic_imputed[24, c("gender", "age", "class", "fare", "sibsp", "parch")]

## Not run: 
pl <- predict_diagnostics(explainer_glm, johny_d, variables = NULL)
plot(pl)

pl <- predict_diagnostics(explainer_glm, johny_d,
                       neighbors = 10,
                       variables = c("age", "fare"))
plot(pl)

pl <- predict_diagnostics(explainer_glm,
                       johny_d,
                       neighbors = 10,
                       variables = c("class", "gender"))
plot(pl)

## End(Not run)

DALEX documentation built on July 8, 2020, 7:17 p.m.