# NOT RUN {
# load germancredit data
data(germancredit)
dt <- germancredit[, c("creditability", "credit.amount", "purpose")]
bins <- woebin(dt, y = "creditability")
# }
# NOT RUN {
# binning for germancredit dataset
bins_germ <- woebin(germancredit, y = "creditability")
# subset dataset
dt2 <- germancredit[, c("creditability", "age.in.years",
"credit.amount", "housing", "purpose")]
# customizing stop_limit (infovalue grain ratio) for each x variable
bins_cus_sl <- woebin(dt2, y="creditability", stop_limit=c(0.05,0.1,0.01,0.1))
# customizing the breakpoints of binning
breaks_list <- list(
age.in.years = c(25, 35, 40, 60),
credit.amount = NULL,
housing = c("own", "for free%,%rent"),
purpose = NULL
)
bins_cus_brk <- woebin(dt2, y="creditability", breaks_list=breaks_list)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab