information_value: Calculate the Information Value for a given variable and set...

Description Usage Arguments Details Value See Also

Description

This function calculates the Weight of Evidence for each supplied bin using woe_single, then applies the formula for Information Value to the result. See the vignette for more details.

Usage

1
2
information_value(dat, var, bins = 0, response, warn = TRUE,
  auto_merge = FALSE)

Arguments

dat

The dataframe containing the input variable and response

var

Character string indicating the name of the variable

bins

Numeric vector of cutpoints defining the bins for var, or 0, indicating that var is already binned

response

Character string indicating the name of the response

warn

Logical- should the function print a warning if a given bin contains only one level of the response (and hence has a WOE of +/- Inf)? Recommended to keep this to TRUE; FALSE option is provided for using this function in programming

auto_merge

Logical. If bins contain only one value of the response, should they be merged with an adjacent bin? If set to TRUE and warn is set to FALSE, the function can modify your data without telling you- be careful

Details

This function is designed as a helper, to be used in analyzing IV for a given binning structure or in applying an optimization routine to find optimal bins for variables in a dataset. When bins have only one level of the response, the WOE will be +/-; by default the function will not prevent this and issue a warning. You can turn off warnings and have the function auto-merge bins using the supplied options, but be sure to inspect the results carefully.

Value

A single number giving the Information Value

See Also

woe_single

Other metrics: woe_single


awstringer/innR2binnR documentation built on May 11, 2019, 4:11 p.m.