View source: R/bins_unsupervised.R
bins_unsupervised | R Documentation |
Unsupervised Automatic Binning Function By setting bin_nums, perform three unsupervised automatic binning
bins_unsupervised(
df,
id,
label,
methods = c("k_means", "equal_width", "equal_freq"),
bin_nums
)
df |
A data.frame with independent variables and target variable. |
id |
A name of index. |
label |
A name of target variable. |
methods |
Simultaneously calculate three kinds of unsupervised binning("k_means","equal_width","equal_freq" ), the parameters only determine the final output result. |
bin_nums |
Number of bins. |
A data frame, including the contents of the bin, the upper bound of the bin, the lower bound of the bin, and all the contents returned by the get_IV function.
accepts <- read.csv( system.file( "extdata" , "accepts.csv" , package = "autoScorecard" ))
feature <- stats::na.omit( accepts[,c(1,3,7:23)] )
f_1 <-bins_unsupervised( df = feature , id="application_id" , label="bad_ind" ,
methods = c("k_means", "equal_width","equal_freq" ) , bin_nums=10 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.