Description Usage Arguments Examples
Cross Validation for kNNImpute Artificially erase some data and run kNNImpute multiple times, varying k from 1 to k.max. For each k, compute the RMSE on the subset of x for which data was artificially erased.
1 | cv.kNNImpute(x, k.max = 5, parallel = F)
|
x |
a data frame or matrix where each row represents a different record |
k.max |
the largest amount of neighbors to try kNN Impute |
parallel |
runs each run for k = 1 to k = k.max in parallel. Requires a parallel backend to be registered |
1 2 3 4 | x = matrix(rnorm(100),10,10)
x.missing = x > 1
x[x.missing] = NA
cv.kNNImpute(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.