create_infotables: Create WOE/NWOE tables and rank variables by IV/NIV

Description Usage Arguments Examples

Description

create_infotables returns WOE or NWOE tables (as data.frames), and a data.frame with IV or NIV values for all predictive variables.

Usage

1
2
create_infotables(data = NULL, valid = NULL, y = NULL, bins = 10,
  trt = NULL, ncore = NULL, parallel = TRUE)

Arguments

data

input data.frame for analysis (this is typically your training dataset).

valid

validation data.frame (default is NULL). Must have the same variables as the training dataset.

y

dependent variable.

bins

number of bins (default is 10).

trt

binary treatment variable for uplift analysis (Default is NUL).

ncore

number of cores used. Default is to use available cores - 1.

parallel

set to TRUE for parallel processing. Number of cores is determined by the ncore parameter.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 
##------------------------------------------------------------
## WOE analysis, no cross validation
##------------------------------------------------------------
library(Information)
data(train, package="Information")
train <- subset(train, TREATMENT==1)
IV <- Information::create_infotables(data=train, y="PURCHASE", parallel=FALSE)
print(head(IV$Summary), row.names=FALSE)
print(IV$Tables$N_OPEN_REV_ACTS, row.names=FALSE)
closeAllConnections()

Example output

[1] "Variable TREATMENT was removed because it has only 1 unique level"
                    Variable        IV
             N_OPEN_REV_ACTS 1.0107695
        TOT_HI_CRDT_CRDT_LMT 0.9345902
        RATIO_BAL_TO_HI_CRDT 0.8232539
 D_NA_M_SNC_MST_RCNT_ACT_OPN 0.6355466
  M_SNC_OLDST_RETAIL_ACT_OPN 0.5573438
      M_SNC_MST_RCNT_ACT_OPN 0.5026402
 N_OPEN_REV_ACTS    N    Percent        WOE        IV
           [0,0] 1469 0.29545455 -2.0465968 0.6401443
           [1,2]  958 0.19267900 -0.5900120 0.6958705
           [3,3]  310 0.06234916  0.2033085 0.6986029
           [4,5]  583 0.11725664  0.4419768 0.7244762
           [6,8]  632 0.12711183  0.6148243 0.7810611
          [9,11]  453 0.09111022  0.8815772 0.8692672
         [12,48]  567 0.11403862  0.9883818 1.0107695

Information documentation built on May 2, 2019, 7:15 a.m.