Learn R Programming

autoScorecard (version 0.3.0)

best_iv: Calculate the Best IV Value for the Binned Data

Description

Calculate the Best IV Value for the Binned Data

Usage

best_iv(df, variable, bin, method, label_iv)

Value

A data frame of best IV, including the contents of the bin, the upper bound of the bin, the lower bound of the bin, and all the contents returned by the get_IV function.

Arguments

df

A data.frame with independent variables and target variable.

variable

Name of variable.

bin

Name of bins.

method

Name of method.

label_iv

Name of IV.

Examples

Run this code
accepts <- read.csv( system.file( "extdata" , "accepts.csv" , package = "autoScorecard" ))
feature <- stats::na.omit( accepts[,c(1,3,7:23)] )
f_1 <-bins_unsupervised(  df = feature , id="application_id" , label="bad_ind" ,
methods = c("k_means", "equal_width","equal_freq"  )  ,  bin_nums=10  )
best1 <- best_iv( df=f_1 ,bin=c('bins') ,  method = c('method') ,
variable= c( "variable" )  ,label_iv='miv'  )

Run the code above in your browser using DataLab