Description Usage Arguments Details Value See Also Examples
This function takes a dataframe where any number of columns have been binned into factors using cut/vector_bin and returns a named list containing the cutpoints for each variable. This is useful for, for example, binning a new dataset into the same bins as an older dataset- such as when making predictions on test data
1 |
d |
a tbl |
parallel |
logical. If TRUE, parallel foreach used. Must register parallel beforehand. Default false |
This function essentially calls get_vector_cutpoints
on all
factor type columns of d
. It is meant to be used to provide an output
format that works with the bins
argument of simple_bin
,
for the purpose of defining cutpoints based on one dataset and then applying
them to other datasets. The basic functionality of binning on training data
and applying those bins to test data is built right in to
simple_bin
, but this function allows the user total
flexibility.
a named list containing one vector for each factor type variable. Each vector contains the unique cut points of that variable
get_vector_cutpoints
, simple_bin
Other discretization: get_vector_cutpoints
,
simple_bin
, vector_bin
1 2 3 4 | x <- dplyr::data_frame(v1 = cut(rnorm(100),c(-1,0,1)),
v2 = cut(rnorm(100),c(-.5,0,.5)))
binned_data_cutpoints(x)
binned_data_cutpoints(x,parallel = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.