Learn R Programming

autoScorecard (version 0.3.0)

get_IV: Function to Calculate IV Value

Description

Function to Calculate IV Value

Usage

get_IV(df, feat, label, E = 0, woeInf.rep = 1e-04)

Value

A data frame including counts, proportions, odds, woe, and IV values for each stratum.

Arguments

df

A data.frame with independent variables and target variable.

feat

A name of dependent variable.

label

A name of target variable.

E

Constant, should be set to [0,1], used to prevent calculation overflow due to no data in binning.

woeInf.rep

Woe replaces the constant, and when woe is positive or negative infinity, it is replaced by a constant.

Examples

Run this code
accepts <- read.csv( system.file( "extdata", "accepts.csv", package = "autoScorecard" ))
feature <- stats::na.omit( accepts[,c(1,3,7:23)] )
iv1 = get_IV( df= feature ,feat ='tot_derog' , label ='bad_ind'  )

Run the code above in your browser using DataLab