Description Usage Arguments Value See Also Examples
View source: R/IterativeQuantileNearestNeighbors.R
Predict the response value for test data using iqnn model defined using training data from the iqnn
function
1 | iqnn_predict(iqnn_mod, test_data, type = "estimate", strict = FALSE)
|
iqnn_mod |
iterative quantile nearest neighbors model generated by the |
test_data |
Data frame of test data to estimate response values for |
type |
output "estimate", "binsize", or "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. |
predicted responses, number of neighbors or both
Other iterative quantile nearest-neighbors functions: iqnn_cv_predict
,
iqnn_tune
, iqnn
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Test Regression
test_index <- c(1,2,51,52,101,102)
iqnn_mod <- iqnn(data=iris[-test_index,], y="Petal.Length",
bin_cols=c("Sepal.Length","Sepal.Width","Petal.Width"),
nbins=c(3,5,2), jit=rep(0.001,3), stretch=TRUE, tol=rep(.001,3))
test_data <- iris[test_index,]
iqnn_predict(iqnn_mod, test_data,strict=FALSE)
iqnn_predict(iqnn_mod, test_data,strict=TRUE)
iqnn_predict(iqnn_mod, test_data,type="both")
# Test Classifier
iqnn_mod <- iqnn(data=iris[-test_index,], y="Species", mod_type="class",
bin_cols=c("Sepal.Length","Sepal.Width","Petal.Width"),
nbins=c(3,5,2), jit=rep(0.001,3))
test_data <- iris[test_index,]
iqnn_predict(iqnn_mod, test_data,strict=TRUE)
iqnn_predict(iqnn_mod, test_data,type="both",strict=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.