bin_by_iq_def: Iterative Quantile Binning New Data from defined bins

Description Usage Arguments Value Examples

Description

New observations selected from the same population as the data used to build bin definitions may fall just outside the bins. If we wish to include nearby values we can either allow outer bins to be extended (this function) or to leave the outer bins unbounded.

Usage

1
bin_by_iq_def(bin_def, new_data, output = "data", strict = FALSE)

Arguments

new_data

Data frame with column names matching the binned columns from bin-training data

output

Matches format of iterative_quant_bin and inherets properties from iqnn if applicable "data","both"

strict

TRUE/FALSE: If TRUE Observations must fall within existing bins to be assigned; if FALSE the outer bins in each dimension are unbounded to allow outlying values to be assigned.

iq_def

Iterative quantile binning definition list

Value

updated binning definition with bins extended by tolerance values

Examples

1
2
3
4
withhold_index <- c(1,2,51,52,101,102)
iq_def <- iterative_quant_bin(data=iris[-withhold_index,], bin_cols=c("Sepal.Length","Sepal.Width","Petal.Width"),
                              nbins=c(3,2,2), output="definition")
bin_by_iq_def(bin_def=iq_def, new_data=iris[withhold_index,], output="data")

kmaurer/binsemble documentation built on May 7, 2019, 9:50 p.m.