Uses a kd-tree to find the p number of near neighbours for each point in an input/output dataset.
matrix; input data matrix
integer; number of nearest neighbours
Use the nn2 function from the RANN package, utilizes the Approximate Near Neighbor (ANN) C++ library, which can give the exact near neighbours or (as the name suggests) approximate near neighbours to within a specified error bound. For more information on the ANN library please visit http://www.cs.umd.edu/~mount/ANN/.
a n-by-k matrix of neighbor indices
1 2 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.