Description Usage Arguments Details Value See Also
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.
1 2 | information_value(dat, var, bins = 0, response, warn = TRUE,
auto_merge = FALSE, output_cutpoints = FALSE)
|
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 |
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 |
output_cutpoints |
Logical. If TRUE, a list with the IV and the final cutpoints used to compute it is returned. Default FALSE, in which case a single number representing the IV is returned |
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.
If output_cutpoints is TRUE
, a list containing the IV and the final
cutpoints used (after auto_merging, if applicable). If output_cutpoints
is FALSE
, A single number giving the Information Value.
woe_single
Other metrics: woe_single
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.