k-nearest neighbor classification using a NVIDIA GPU via CUDA backend
knn_cuda(k, samples, centroids, assignments, metric = "L2", device = 0,
verbosity = 0)The number of neighbors to search for each sample
Numeric matrix
Numeric matrix with precalculated clusters' centroids
integer vector with sample-cluster associations. Indices start from 1.
character name of the distance metric to use. The default is Euclidean (L2), it can be changed to "cos" for Sphereical K-means with angular distance. NOTE - the samples must be normalized in the latter case.
integer defining device to use. 1 = first device, 2 = second device, 3 = first & second devices, 0 = use all devices. Default = 0
Integer indicating amount of output to see. 0 = silence, 1 = progress logging, 2 = all output
Integer matrix with neighbor indices of shape [nsamp, k].