powered by
Compute bins for discretization of numeric variable (either equal_width or equal_fred).
build_bins( dataSet, cols = "auto", n_bins = 10, type = "equal_width", verbose = TRUE )
Matrix, data.frame or data.table
List of numeric column(s) name(s) of dataSet to transform. To transform all characters, set it to "auto". (character, default to "auto")
Number of group to compute (numeric, default to 10)
Type of discretization ("equal_width" or "equal_freq")
Should the algorithm talk? (Logical, default to TRUE)
A list where each element name is a column name of data set and each element contains bins to discretize this column.
Using equal freq first bin will start at -Inf and last bin will end at +Inf.
# NOT RUN { # Load data data(messy_adult) head(messy_adult) # Compute bins bins <- build_bins(messy_adult, cols = "auto", n_bins = 5, type = "equal_freq") print(bins) # }
Run the code above in your browser using DataLab