Description Usage Arguments Details Value See Also
Function to apply simple equal-width or equal-height binning to columns of a training dataset, and then optionally bin the columns of a test set into bins with the appropriate cutpoints
1 2 |
train |
training set |
test |
test set |
exclude_vars |
variables to exclude (e.g. the target, or the row ID) |
include_vars |
if you only want certain variables binned, you may specify them directly instead of excluding all other variables |
bins |
single number specifying the number of bins to create on each variable, or a named list specifying cut-points for each variable |
type |
if bins is given as a number, then this determines whether to create bins with equal number of observations ("height") or of equal width ("width") |
na_include |
logical. Give missing values their own bin? |
This function was built as a convenience, to automate the process of binning continuous variables into disrete levels, and also to provide a simple, interpretible, unambiguous method of dealing with missing values in data science problems.
if test is not NULL, a list containing two tbl_df objects, with appropriate columns replaced by their binned values and all other columns unchanged if test is NULL, returns the training set portion of the list
vector_bin
, get_vector_cutpoints
Other discretization: binned_data_cutpoints
,
get_vector_cutpoints
,
vector_bin
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.