loop_plot_fcn: Generate partial dependency plots for multiple features

Description Usage Arguments Value Examples

Description

Run plot_fn over output from loop_calculate_partial_dependency

Usage

1

Arguments

pd_list

output from loop_calculate_partial_dependency

plot_fcn

a function that accepts the output from calculate_partial_dependency and returns a ggplot object. This function will be looped over pd_list.

Value

a list of ggplot objects

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
# Example output from loop_calculate_partial_dependency
pd <- list(a = data.table(feature = rep("a", 9),
                          feature_val = rep(c(1, 3.5, 6), 3),
                          model = rep(c("model1",
                                        "model2",
                                        "ensemble"),
                                      each = 3),
                          prediction = c(c(-2.5, 0, 2.5),
                                       c(0, 0, 0),
                                       c(-2.5, -0.75, 0))),
           b = data.table(feature = rep("b", 9),
                          feature_val = rep(c(2, 3, 4), 3),
                          model = rep(c("model1",
                                        "model2",
                                        "ensemble"),
                                      each = 3),
                          prediction = c(c(0, 0, 0),
                                       c(0, 0, 0),
                                       c(1, 2, 3))))
loop_plot_fcn(pd)

## End(Not run)

breather/brightbox documentation built on May 13, 2019, 5:04 a.m.