Learn R Programming

scorecard (version 0.1.2)

woebin_ply: Application of Binning

Description

woebin_ply converts original input data into woe values based on the binning information generated by woebin.

Usage

woebin_ply(dt, bins, print_step = TRUE)

Arguments

dt

A data frame.

bins

Binning information generated by woebin.

print_step

Logical. If it is TRUE, print the variable name when converting data into woe.

Value

Binning information

See Also

woebin, woebin_plot

Examples

Run this code
# NOT RUN {
# load germancredit data
data(germancredit)

# Example I
dt <- germancredit[, c("creditability", "credit.amount", "purpose")]

# binning for dt
bins <- woebin(dt, y = "creditability")

# converting original value to woe
dt_woe <- woebin_ply(dt, bins=bins)

# }
# NOT RUN {
# Example II
# binning for germancredit dataset
bins_germancredit <- woebin(germancredit, y="creditability")

# converting the values of germancredit into woe
# bins is a list which generated from woebin()
germancredit_woe <- woebin_ply(germancredit, bins_germancredit)

# bins is a dataframe
bins_df <- data.table::rbindlist(bins_germancredit)
germancredit_woe <- woebin_ply(germancredit, bins_df)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab