loop_calculate_pd_vimp: Convenience function to calculate variable importance over...

Description Usage Arguments Value 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
loop_calculate_pd_vimp(pd_list, vimp_colname = "ensemble")

Arguments

pd_list

output from loop_calculate_partial_dependency

vimp_colname

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

Value

a list the length of pd_list, containing the variable importance of each feature

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# Example output from loop_calculate_partial_dependency
pd <- list(a = data.table(feature = c("a", "a", "a"),
                          feature_val = c(1, 3.5, 6),
                          model1 = c(-2.5, 0, 2.5),
                          model2 = c(0, 0, 0),
                          ensemble = c(-2.5, -0.75, 0)),
           b = data.table(feature = c("b", "b", "b"),
                          feature_val = c(2, 3, 4),
                          model1 = c(0, 0, 0),
                          model2 = c(0, 0, 0),
                          ensemble = c(1, 2, 3)))
loop_calculate_pd_vimp(pd, vimp_colname = "ensemble")

## End(Not run)

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