calculate_pd_vimp: Calculate variable importance based on partial dependency

Description Usage Arguments Examples

Description

Variable importance is calculated as the difference between the min and max of the partial dependency output for a given feature

Usage

1
calculate_pd_vimp(pd, vimp_colname = "ensemble")

Arguments

pd

output from calculate_partial_dependency

vimp_colname

name of model (taken from the column names in pd) for which to calculate variable importance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# Example output from calculate_partial_dependency
pd <- 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)))
calculate_pd_vimp(pd, vimp_colname = "ensemble")

## End(Not run)

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