umap (version 0.2.2.0)

knn.from.dist: get information about k nearest neighbors from a distance object or from a matrix with distances

Description

This implementation uses sorting of distances to identify the k elements that are nearest to each data point. The result is deterministic and exact.

Usage

knn.from.dist(d, k)

Arguments

d

dist object or matrix with distances

k

integer, number of neighbors

Value

list with two components; indexes identifies, for each point in dataset, the set of k neighbors distances provides distances from each point to those neighbors

Details

By definition, the first nearest neighbor to each point is the point itself. Subsequent neighbors are "true" neighbors.