ScorecardProfet {Rprofet} | R Documentation |
Scorecard Builder
Description
Function that fits a logistic regression models and scores points for each bin and calculates observations' total score.
Usage
ScorecardProfet(
object,
id,
target,
GLModel,
PDO = 100,
BaseOdds = 10,
BasePts = 1000,
reverse = FALSE
)
Arguments
object |
A WOEProfet object or a Var_select object that containing dataframes with binned and WOE values. |
id |
ID variable. |
target |
A binary target variable. |
GLModel |
A generalized linear model, glm object. |
PDO |
Points to Double Odds. |
BaseOdds |
Base Odds. |
BasePts |
Base Points. |
reverse |
Logical. If FALSE, higher points corresponds to a lower probability of being target. |
Value
A scorecard dataframe.
Examples
mydata <- ISLR::Default
mydata$ID = seq(1:nrow(mydata)) ## make the ID variable
mydata$default<-ifelse(mydata$default=="Yes",1,0) ## Creating numeric binary target variable
binned <- BinProfet(mydata, id= "ID", target= "default", num.bins = 5) ## Binning variables
WOE_dat <- WOEProfet(binned, "ID","default", 3:5) ## WOE transformation of bins
md <- glm(default ~ student_WOE+balance_WOE+income_WOE, data=WOE_dat$WOE, family="binomial")
summary(md)
Score_dat <- ScorecardProfet(object=WOE_dat, id="ID", target="default", GLModel=md,
PDO = 50, BaseOdds = 10, BasePts = 1000, reverse = FALSE)
Score_dat ## Less points means more likely to default
[Package Rprofet version 3.1.1 Index]