Description Usage Arguments Value See Also Examples

View source: R/03_WOE_BINNING.R

`woe.bin`

implements extension of the three-stage monotonic binning procedure (`iso.bin`

)
with weights of evidence (WoE) threshold.
The first stage is isotonic regression used to achieve the monotonicity. The next two stages are possible corrections for
minimum percentage of observations and target rate, while the last stage is iterative merging of
bins until WoE threshold is exceeded.

1 2 3 4 5 6 7 8 9 10 11 |

`x` |
Numeric vector to be binned. |

`y` |
Numeric target vector (binary or continuous). |

`sc` |
Numeric vector with special case elements. Default values are |

`sc.method` |
Define how special cases will be treated, all together or in separate bins.
Possible values are |

`y.type` |
Type of |

`min.pct.obs` |
Minimum percentage of observations per bin. Default is 0.05 or minimum 30 observations. |

`min.avg.rate` |
Minimum |

`woe.gap` |
Minimum WoE gap between bins. Default is 0.1. |

`force.trend` |
If the expected trend should be forced. Possible values: |

The command `woe.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.
In case of single unique value for `x`

or `y`

of complete cases (cases different than special cases),
it will return data frame with info.

`iso.bin`

for three-stage monotonic binning procedure.

1 2 3 4 5 6 7 8 | ```
suppressMessages(library(monobin))
data(gcd)
amount.bin <- woe.bin(x = gcd$amount, y = gcd$qual)
amount.bin[[1]]
diff(amount.bin[[1]]$woe)
tapply(gcd$amount, amount.bin[[2]], function(x) c(length(x), mean(x)))
woe.bin(x = gcd$maturity, y = gcd$qual)[[1]]
woe.bin(x = gcd$maturity, y = gcd$qual, woe.gap = 0.5)[[1]]
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.