ush.bin | R Documentation |
ush.bin
performs U-shape binning. All algorithms from monobin
package are available. Due to specific nature of
binning algorithms it is possible that for some selected knots algorithm will not be able to find U-shape. Therefore,
users are encourage to inspect the results more into details and to try different binning algorithms.
ush.bin(
x,
y,
knot,
method,
sc = c(NA, Inf, -Inf, NaN),
sc.method = "together",
g = 20,
min.pct.obs = 0.05,
min.avg.rate = 0.01,
p.val = 0.05,
woe.trend = TRUE,
woe.gap = 0.1
)
x |
Numeric vector to be binned. |
y |
Numeric target vector (binary). |
knot |
Numeric value of selected knot. Usually the results of |
method |
Binning method. Available options are all from monobin package:
|
sc |
Numeric vector with special case elements. Default values are |
sc.method |
Define how special cases will be treated, all together or separately.
Possible values are |
g |
Number of starting groups. Only needed for |
min.pct.obs |
Minimum percentage of observations per bin. Default is 0.05 or 30 observations. |
min.avg.rate |
Minimum |
p.val |
Threshold for p-value. Only needed for |
woe.trend |
Logical. Only needed for |
woe.gap |
Minimum WoE gap between bins. Only needed for |
The command ush.bin
generates a list of two objects. The first object, data frame summary.tbl
presents a summary table of final binning, while x.trans
is a vector of discretized values.
res <- ush.bin(x = gcd$amount, y = gcd$qual, knot = 2992.579, method = "ndr.bin")
res[[1]]
plot(res[[1]]$dr, type = "l")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.