noauto_scorecard {autoScorecard} | R Documentation |
Manually Input Parameters to Generate Scorecards
Description
Manually Input Parameters to Generate Scorecards
Usage
noauto_scorecard(
bins_card,
fit,
bins_woe,
points0 = 600,
odds0 = 1/19,
pdo = 50,
k = 2
)
Arguments
bins_card |
Binning template. |
fit |
See glm stats. |
bins_woe |
A data frame of woe with independent variables and target variable. |
points0 |
Base point. |
odds0 |
odds. |
pdo |
Point-to Double Odds. |
k |
Each scale doubles the probability of default several times. |
Value
A data frame with score ratings.
Examples
accepts <- read.csv( system.file( "extdata", "accepts.csv" , package = "autoScorecard" ))
feature <- stats::na.omit( accepts[,c(1,3,7:23)] )
d = sort( sample( nrow( feature ), nrow( feature )*0.7))
train <- feature[d,]
test <- feature[-d,]
treebins_train <- bins_tree( df = train, key_var = "application_id", y_var="bad_ind",
max_depth=3, p=0.1)
woe_train <- rep_woe( df= train , key_var = "application_id", y_var = "bad_ind" ,
tool = treebins_train ,var_label = "variable",col_woe = 'woe', lower = 'lower' , upper = 'upper')
woe_test <- rep_woe( df = test , key_var ="application_id", y_var= "bad_ind",
tool = treebins_train ,var_label= "variable",
col_woe = 'woe', lower = 'lower' ,upper = 'upper' )
lg <- stats::glm( bad_ind~. , family = stats::binomial( link = 'logit' ) , data = woe_train )
lg_both <- stats::step( lg , direction = "both")
Score1 <- noauto_scorecard( bins_card= woe_test , fit =lg_both , bins_woe = treebins_train ,
points0 = 600 , odds0 = 1/20 , pdo = 50 )
[Package autoScorecard version 0.3.0 Index]