Description Usage Arguments Details Value Examples
Function that calculates the WOE for each bin and the information value for each variable.
1 | WOEProfet(dat, id, target, varcol)
|
dat |
Dataframe of binned variables. |
id |
ID variable. |
target |
A binary target variable. |
varcol |
Vector of variables to have WOE transformation. |
The id
and the target
variables must be provided.
The target
variable must be a numeric binary variable.
A list with the following components.
BinWOE |
Dataframe with the binned variables and their WOE values. |
WOE |
Dataframe with the WOE values. |
IV |
Each attribute and their associated information values. |
vars |
A list containing the different WOE values for each attribute. |
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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)
head(WOE_dat$BinWOE)
head(WOE_dat$WOE)
WOE_dat$IV
head(WOE_dat$vars$income)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.