gbm_bin: Monotonic binning based on generalized boosted model

Description Usage Arguments Value Examples

View source: R/gbm_bin.R

Description

The function gbm_bin implements the monotonic binning based on the generalized boosted model (GBM).

Usage

1
gbm_bin(x, y)

Arguments

x

A numeric vector

y

A numeric vector with 0/1 binary values

Value

A list of binning outcomes, including a numeric vector with cut points and a dataframe with binning summary

Examples

1
2
data(hmeq)
gbm_bin(hmeq$DEROG, hmeq$BAD)

Example output

$cut
[1] 0 1 2 3

$tbl
  bin freq miss bads   rate     woe     iv    ks               rule
1   0  708  708   87 0.1229 -0.5760 0.0328  5.70         is.na($X$)
2   1 4527    0  754 0.1666 -0.2208 0.0346 21.37           $X$ <= 0
3   2  435    0  169 0.3885  0.9358 0.0808 12.73 $X$ > 0 & $X$ <= 1
4   3  160    0   82 0.5125  1.4395 0.0757  7.47 $X$ > 1 & $X$ <= 2
5   4   58    0   43 0.7414  2.4426 0.0807  4.16 $X$ > 2 & $X$ <= 3
6   5   72    0   54 0.7500  2.4881 0.1036  0.00            $X$ > 3

mob documentation built on July 31, 2021, 9:06 a.m.

Related to gbm_bin in mob...