woe.binning.table: Tabulation of Binning

Description Usage Arguments Details Examples

Description

woe.binning.table tabulates the binning solution generated and saved via the woe.binning or woe.tree.binning function.

Usage

1

Arguments

binning

Binning information generated from the woe.binning or woe.tree.binning function. Contains names of the input predictor variables and the corresponding binning, counts, WOE and IV information, which is used to generate the tables.

Details

For each predictor variable woe.binning.table generates a table (data frame). This table contains the final bin labels, total counts, total distribution (column percentages), counts for the first and the second target class, distribution of the first and the second target class (column percentages), rate (row percentages) of the target event specified via the event.class parameter in the woe.binning or woe.tree.binning function, as well as weight of evidence (WOE) and information values (IV).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Load German credit data and create a subset
data(germancredit)
df <- germancredit[, c('creditability', 'credit.amount', 'duration.in.month',
                  'savings.account.and.bonds', 'purpose')]

# Bin all variables of the data frame (apart from the target variable)
# with default parameter settings
binning <- woe.binning(df, 'creditability', df)

# Tabulate the binned variables
tabulate.binning <- woe.binning.table(binning)
tabulate.binning

## Not run: 

# Plot a layouted table (using the gridExtra library) for a specific
# variable (in this example for the first binned variable
# with the highest IV value)
library(gridExtra)
grid.table(tabulate.binning[[1]],
          theme = ttheme_default(core=list(bg_params=
                  list(fill=c(rep(c('grey95','grey90'),
                  length.out=nrow(tabulate.binning[[1]])-1),
                  '#BCC7BD')),fg_params=list(cex=0.8)),
                  colhead=list(fg_params=list(cex=0.8))),
                  rows=NULL)

## End(Not run)

rogelioandrade/woeBinning documentation built on May 5, 2019, 12:32 p.m.