smbinning.sumiv: Information Value Summary

Description Usage Arguments Value Examples

View source: R/smbinning.R

Description

It gives the user the ability to calculate, in one step, the IV for each characteristic of the dataset. This function also shows a progress bar so the user can see the status of the process.

Usage

1

Arguments

df

A data frame.

y

Binary response variable (0,1). Integer (int) is required. Name of y must not have a dot. Name "default" is not allowed.

Value

The command smbinning.sumiv generates a table that lists each characteristic with its corresponding IV for those where the calculation is possible, otherwise it will generate a missing value (NA).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Load library and its dataset
library(smbinning)

# Test sample
test=subset(smbsimdf1,rnd>0.9) # Training sample
test$rnd=NULL

# Example: Information Value Summary
testiv=smbinning.sumiv(test,y="fgood")
testiv

# Example: Plot of Information Value Summary
smbinning.sumiv.plot(testiv)

Example output

Loading required package: sqldf
Loading required package: gsubfn
Loading required package: proto
Loading required package: RSQLite
Loading required package: partykit
Loading required package: grid
Loading required package: libcoin
Loading required package: mvtnorm
Loading required package: Formula
Warning message:
no DISPLAY variable so Tk is not available 
 

  |                                                        
  |                                                  |   0%
  |                                                        
  |--                                                |   5%
  |                                                        
  |-----                                             |  10%
  |                                                        
  |-------                                           |  14%
  |                                                        
  |----------                                        |  19%
  |                                                        
  |------------                                      |  24%
  |                                                        
  |--------------                                    |  29%
  |                                                        
  |-----------------                                 |  33%
  |                                                        
  |-------------------                               |  38%
  |                                                        
  |---------------------                             |  43%
  |                                                        
  |------------------------                          |  48%
  |                                                        
  |--------------------------                        |  52%
  |                                                        
  |-----------------------------                     |  57%
  |                                                        
  |-------------------------------                   |  62%
  |                                                        
  |---------------------------------                 |  67%
  |                                                        
  |------------------------------------              |  71%
  |                                                        
  |--------------------------------------            |  76%
  |                                                        
  |----------------------------------------          |  81%
  |                                                        
  |-------------------------------------------       |  86%
  |                                                        
  |---------------------------------------------     |  90%
  |                                                        
  |------------------------------------------------  |  95%
  |                                                        
  |--------------------------------------------------| 100%
 
       Char     IV                Process
12      dpd 1.3782      Factor binning OK
11      tob 1.0906     Numeric binning OK
13      dep 1.0667     Numeric binning OK
2      cbs2 0.9231     Numeric binning OK
16     home 0.8213      Factor binning OK
1      cbs1 0.7871     Numeric binning OK
10      pmt 0.6140      Factor binning OK
18       dd 0.5532      Factor binning OK
15       od 0.5458      Factor binning OK
5    cbterm 0.4800      Factor binning OK
6  cblineut 0.4096     Numeric binning OK
8     cbdpd 0.3333      Factor binning OK
4    cbline 0.3330     Numeric binning OK
14       dc 0.3284     Numeric binning OK
9     cbnew 0.2878      Factor binning OK
3     cbinq 0.2147      Factor binning OK
7     cbtob 0.1593     Numeric binning OK
19   online 0.1043      Factor binning OK
17      inc     NA    Too many categories
20   period     NA Not numeric nor factor

smbinning documentation built on May 1, 2019, 10:06 p.m.