Description Usage Arguments Value Examples
This is an easy categorical binning solution for credit scorecard build. It is designed to group the optimal categories by utilizing the Recursive Partitioning which is only applied on factor variables.
1 | sc.cat.binning(data, target, n = 10, unique = 4, parallel = FALSE)
|
data |
A data frame which contains target varible as well as predictor variables. |
target |
Target variable name. |
n |
Number of bootstrap iterations. Default 10 times. |
unique |
The minimum number of unique values within predictor variables. Default 4. |
parallel |
A logical scalar. Use parallel backend. Default FALSE. |
The output is a list of group plan which can be applied to the orginal data frame via
the predict
function.
The user can also update the cut plan via the update
function.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
# Load library
library(easysc)
# Generate a grouping plan which maximize IV via 500 bootstrap resampling
group.plan <- sc.cat.binning(data = df, target = BAD, n = 500, parallel = TRUE)
# Update the grouping plan
update(group.plan, MARRIAGE = list(c('SINGLE', 'DIVORCE'),
c('MARRIED', 'WIDOW'))
# Apply to the data frame
predict(group.plan, df, keepTarget = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.