Description Usage Arguments Value See Also Examples
View source: R/IterativeQuantileNearestNeighbors.R
Cross-validate an iqnn specification using k-fold scheme on given data
1 2 3 |
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 |
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. |
cv_k |
integer specifying number of folds |
cross validated predicted responses for all observations in data
Other iterative quantile nearest-neighbors functions: iqnn_predict
,
iqnn_tune
, iqnn
1 2 3 4 5 6 7 8 9 | cv_preds <- iqnn_cv_predict(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), strict=FALSE, cv_k=10)
table(cv_preds, iris$Species)
cv_preds <- iqnn_cv_predict(data=iris, y="Petal.Length",mod_type="reg",
bin_cols=c("Sepal.Length","Sepal.Width","Petal.Width"),
nbins=c(3,5,2), jit=rep(0.001,3), strict=FALSE, cv_k=10)
table(cv_preds, iris$Species)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.