Description Usage Arguments Value Examples
Computes K-nearest neighbors of given observation
1 | nearestNeighbors(distance.mat, point, K)
|
distance.mat |
Matrix of pairwise distances of observations |
point |
Given observation to find nearest neighbors of |
K |
number of nearest neighbors |
Vector of nearest neighbors
1 2 | distMat <- pairwiseDistance(iris[1:50, 1:4])
neighborsVec <- nearestNeighbors(distMat, 3, 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.