# Load German credit data
data(germancredit)
# Example I
bins1 = woebin(germancredit, y="creditability", x="credit.amount")
p1 = woebin_plot(bins1)
print(p1)
# modify line value
p1_w = woebin_plot(bins1, line_value = 'woe')
print(p1_w)
# modify colors
p1_c = woebin_plot(bins1, line_color='#FC8D59', bar_color=c('#FFFFBF', '#99D594'))
print(p1_c)
# show iv, line value, bar value
p1_iv = woebin_plot(bins1, show_iv = FALSE)
print(p1_iv)
p1_lineval = woebin_plot(bins1, show_lineval = FALSE)
print(p1_lineval)
p1_barval = woebin_plot(bins1, show_barval = FALSE)
print(p1_barval)
# \donttest{
# Example II
bins = woebin(germancredit, y="creditability")
plotlist = woebin_plot(bins)
print(plotlist$credit.amount)
# # save binning plot
# for (i in 1:length(plotlist)) {
# ggplot2::ggsave(
# paste0(names(plotlist[i]), ".png"), plotlist[[i]],
# width = 15, height = 9, units="cm" )
# }
# }
Run the code above in your browser using DataLab