iqnn: Iterative Quantile Binned Nearest Neighbors

Description Usage Arguments Value See Also Examples

View source: R/IterativeQuantileNearestNeighbors.R

Description

Function for creating iterative quantile nearest neighbors model. Bin the training data, then store the binning definitions and bin statistics to be used to estimate for future testing data.

Usage

1
2
iqnn(data, y, mod_type = "reg", bin_cols, nbins, jit = rep(0,
  length(bin_cols)), stretch = FALSE, tol = rep(0, length(bin_cols)))

Arguments

data

Data frame containing the response variable and numeric input variables from the training data

y

Name of response variable column

mod_type

Depends on response variables type: "reg" creates iqnn-regression for predicting numeric values, "class" creates iqnn-classifier for predicting categorical values

bin_cols

vector of column names of variables to iteratively bin, ordered first to last

nbins

vector of number of bins per step of iterative binning, ordered first to last

jit

vector of margins for uniform jitter to each dimension to create seperability of tied obs due to finite precision

stretch

TRUE/FALSE if will bins be given tolerance buffer

tol

vector of tolerance values to stretch each dimension for future binning

Value

list containing binned training data, binning definition, and bin statistics

See Also

Other iterative quantile nearest-neighbors functions: iqnn_cv_predict, iqnn_predict, iqnn_tune

Examples

1
2
3
4
iqnn_mod <- iqnn(data=iris, y="Species", mod_type="class",
                 bin_cols=c("Sepal.Length","Sepal.Width","Petal.Width"),
                 nbins=c(3,5,2), jit=rep(0.001,3), tol = rep(0.001,3))
str(iqnn_mod)

kmaurer/iqbin documentation built on Jan. 1, 2020, 6:48 p.m.