scorecard creates a scorecard based on the results from woebin and glm.

scorecard(bins, model, points0 = 600, odds0 = 1/19, pdo = 50,
  basepoints_eq0 = FALSE, digits = 0)

Arguments

bins

Binning information generated from woebin function.

model

A glm model object.

points0

Target points, default 600.

odds0

Target odds, default 1/19. Odds = p/(1-p).

pdo

Points to Double the Odds, default 50.

basepoints_eq0

Logical, Defaults to FALSE. If it is TRUE, the basepoints will equally distribute to each variable.

digits

The number of digits after the decimal point for points calculation. Default 0.

Value

A list of scorecard data frames

Examples

# \donttest{
# load germancredit data
data("germancredit")
# filter variable via missing rate, iv, identical value rate
dtvf = var_filter(germancredit, "creditability")
#>  Filtering variables via missing_rate, identical_rate, info_value ...
#>  1 variables are removed via identical_rate
#>  6 variables are removed via info_value
#>  Variable filtering on 1000 rows and 20 columns in 00:00:00
#>  7 variables are removed in total
# split into train and test
dtlst = split_df(dtvf, y = 'creditability')
# binning
bins = woebin(dtlst$train, "creditability")
#>  Creating woe binning ...
#>  Binning on 681 rows and 14 columns in 00:00:00

# to woe
dtlst_woe = lapply(dtlst, function(d) woebin_ply(d, bins))
#>  Converting into woe values ...
#>  Woe transformating on 681 rows and 13 columns in 00:00:00
#>  Converting into woe values ...
#>  Woe transformating on 319 rows and 13 columns in 00:00:00
# lr
m = glm(creditability ~ ., family = binomial(), data = dtlst_woe$train)
# scorecard
card = scorecard(bins, m)
prob = predict(m, dtlst_woe$train, type='response')
# problst = lapply(dtlst_woe, function(x) predict(m, x, type='response'))

# }