woe.binning.table {woeBinning} | R Documentation |
Tabulation of Binning
Description
woe.binning.table
tabulates the binning solution generated and saved via the woe.binning
or woe.tree.binning
function.
Usage
woe.binning.table(binning)
Arguments
binning |
Binning information generated from the |
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
# 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)