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) ## WOEProfet object
WOE_dat$IV #IV item, the row index will be used for filtering variables
# To remove the income variable from the WOEProfet object
## Select the first two variables based on the IV item
subWOE1 <- Var_select(WOE_dat, id= "ID", target= "default", varcol= c(1,2))
## Or remove the third variable based on the IV item
subWOE2 <- Var_select(WOE_dat, id= "ID", target= "default", varcol= -3)
## Filter the WOEProfet object based on variables' information values
subWOE3 <- Var_select(WOE_dat, id= "ID", target= "default", IVfilter = 0.05)
Run the code above in your browser using DataLab