binned_data_cutpoints: Get the unique cutpoints of each appropriate column in a tbl.
Description
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
Usage
binned_data_cutpoints(d, parallel = FALSE)
Arguments
d
a tbl
parallel
logical. If TRUE, parallel foreach used. Must register
parallel beforehand. Default false
Value
a named list containing one vector for each factor type variable.
Each vector contains the unique cut points of that variable
Details
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.