Description Usage Arguments Details Value Author(s) See Also Examples
Return index and distance for the k nearest neighbors of each observation. Neighbors are obtained using the canonical Euclidian distance.
1 | knn.search(data, k =1)
|
data |
an input data.frame or matrix Where each line corresponds to an observation. |
k |
the maximum number of nearest neighbors to search. |
Neighbors are found using the kd-tree
algorithm.
index |
an n x k matrix of nearest neighbor indices. |
dist |
an n x k matrix of nearest neighbor distances. |
The function has been implemented by Kai Li.
knn.emp
for empirical estimation of the risk, knn.boot
for an exact bootstrap estimation, and knn.cv
for cross-validated estimation for the kNN algorithm.
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.