noauto_scorecard2 {autoScorecard} | R Documentation |
Manually Input Parameters to Generate Scorecards The basic score is dispersed into each feature score
Description
Manually Input Parameters to Generate Scorecards The basic score is dispersed into each feature score
Usage
noauto_scorecard2(
bins_card,
fit,
bins_woe,
points0 = 600,
odds0 = 1/19,
pdo = 50,
k = 3
)
Arguments
bins_card |
Binning template. |
fit |
See glm stats. |
bins_woe |
Base point. |
points0 |
odds. |
odds0 |
Point-to Double Odds. |
pdo |
A data frame of woe with independent variables and target variable. |
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")
Score2 <- noauto_scorecard2( 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]