knn_parallel {bigutilsr} | R Documentation |
Find K nearest neighbours for multiple query points
Description
Find K nearest neighbours for multiple query points
Usage
knn_parallel(data, query = data, k, ..., ncores = bigparallelr::nb_cores())
Arguments
data |
Mxd matrix of M target points with dimension d |
query |
Nxd matrix of N query points with dimension d (nb |
k |
an integer number of nearest neighbours to find |
... |
Arguments passed on to
|
ncores |
Number of cores to use. Default uses |
Value
A list with elements nn.idx
(1-indexed indices) and
nn.dists
(distances), both of which are N x k matrices. See details
for the results obtained with1 invalid inputs.
Examples
## Not run: knn_parallel(matrix(1:4, 2), k = 2, ncores = 2)