woebin_adj: WOE Binning Adjustment

woebin_adjR Documentation

WOE Binning Adjustment

Description

woebin_adj interactively adjust the binning breaks.

Usage

woebin_adj(dt, y, bins, breaks_list = NULL, adj_all_var = TRUE,
  to = "breaks_list", save_as = NULL, ...)

Arguments

dt

A data frame.

y

Name of y variable.

bins

A list of data frames. Binning information generated from woebin.

breaks_list

List of break points, Defaults to NULL. If it is not NULL, variable binning will based on the provided breaks.

adj_all_var

Logical, whether to show variables have monotonic woe trends. Defaults to TRUE

to

Adjusting bins into breaks_list or bins_list. Defaults to breaks_list.

save_as

A string. The file name to save breaks_list. Defaults to None.

...

Additional parameters.

Value

A list of modified break points of each x variables.

See Also

woebin, woebin_ply, woebin_plot

Examples

## Not run: 
# Load German credit data
data(germancredit)

# Example I
dt = germancredit[, c("creditability", "age.in.years", "credit.amount")]
bins = woebin(dt, y="creditability")
breaks_adj = woebin_adj(dt, y="creditability", bins)
bins_final = woebin(dt, y="creditability",
                    breaks_list=breaks_adj)

# Example II adjust two variables' breaks in brklst
binsII = woebin(germancredit, y="creditability", save_as = 'breaks')
brklst = source('breaks.R')$value
# update break list file
brklst_adj = woebin_adj(germancredit, "creditability", binsII[1:2],
                        breaks_list = brklst, save_as = 'breaks')

## End(Not run)


ShichenXie/scorecard documentation built on April 17, 2024, 8:55 p.m.