WOEplotter {Rprofet} | R Documentation |
Visualizing WOE and Target Rates
Description
Function generating three plots: WOE value for each bin, target rate for each bin, and the frequency for each bin.
Usage
WOEplotter(data, target, var, color = "#0066CC")
Arguments
data |
Dataframe containing binned values and a binary target variable. |
target |
A numeric binary target variable. |
var |
The desired WOE binned attribute to visualize. |
color |
A hexadecimal value representing a specific color. |
Details
A list of the hexadecimal colors can be found at this link http://www.sthda.com/sthda/RDoc/images/hextable.gif
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
WOEplotter(binned, target= "default", var= "income_Bins")
##--Changing Colors------------------------------
WOEplotter(binned, target= "default", var= "income_Bins", color = "#33FF33")
[Package Rprofet version 3.1.1 Index]