sc.cat.binning: Categorical binning for Credit Scoring

Description Usage Arguments Value Examples

Description

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.

Usage

1
sc.cat.binning(data, target, n = 10, unique = 4, parallel = FALSE)

Arguments

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.

Value

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.

Examples

 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)

lmtleminh/easysc documentation built on July 5, 2019, 11:48 a.m.