Description Usage Arguments Value Examples
Function that bins a numeric variable based on user inputted breaks, plots the information on the new bins, and returns a vector of the newly binned values
1 | WOE_custom(dataset, var, target, breaks, right_bracket = F, color = "#0066CC")
|
dataset |
Dataframe containing the target variable and desired numeric variables to be binned. |
var |
A specific numeric attribute to be binned. Must be specified. |
target |
A binary target variable. Must be specified. |
breaks |
A vector of breakpoints for the desired bins. Must be specified. |
right_bracket |
Logical. Specifying whether the intervals are closed on the right or the left. |
color |
A hexadecimal value representing a specific color. |
A vector containing the newly binned values. Generates three barplots displaying the worth of evidence (WoE), target rate and frequency across all bins. The bars are arranged in an ascending order of WoE.
1 2 3 4 5 6 7 8 | mydata <- ISLR::Default
mydata$default <- ifelse(mydata$default=="Yes", 1, 0) ## target coded with 1, 0
WC_1 <- WOE_custom(dataset=mydata, var="balance", target = "default",
breaks=seq(0,3000,1000))
levels(factor(WC_1))
WC_2 <- WOE_custom(dataset=mydata, var="income", target = "default",
breaks=seq(0,75000, 15000))
levels(factor(WC_2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.