A package for precise approximative nearest neighbor search in more than just euclidean space.
Its only exported function
find_knn computes the
k nearest neighbors of the rows of the
query matrix in the
query matrix is passed, the nearest neighbors for all rows in the data will be returned (i.e.
data will be used as
find_knn( data, k, ..., query = NULL, distance = c("euclidean", "cosine", "rankcor"), sym = TRUE)
The result will be a list containing
kinteger matrix containing the row indices into
datathat are the nearest neighbors.
kdouble matrix containing the
distances to those neighbors.
Matrix::dSparseMatrix, generic if
!is.null(query), and symmetric if
is.null(query). Zeros in this matrix mean “not a knn”, and if
symis set, the matrix will be post processed to be symmetric.
(Without post processing, the matrix will likely be asymmetric as
r1∈kNN(r2) does not imply
If anyone knows a faster and similarly precise kNN search in cosine (=rank correlation) space, please tell me!
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.