Description Usage Arguments Details Examples
woe.binning.table
tabulates the binning solution generated and saved via the woe.binning
or woe.tree.binning
function.
1 | woe.binning.table(binning)
|
binning |
Binning information generated from the |
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).
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.