umap (version 0.2.2.0)

knn.from.data: get information about approximate k nearest neighbors from a data matrix

Description

This implementation uses a randomization scheme and thus produces results that are nondeterministic and only approximately correct. The algorithm is roughly inspired by Dong et al, but there are differences. This is a rough implementation and improvements are possible.

Usage

knn.from.data(dT, k, metric.function, subsample.k = 0.5,
  fix.observations = NULL)

Arguments

dT

matrix with data (observations in columns, features in rows)

k

integer, number of neighbors

metric.function

function that returns a metric distance

subsample.k

numeric, used for internal tuning of implementation

fix.observations

integer, number of observations in dT that will appear in knn

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 num.computed - for diagnostics only, gives the number of distances computed internally avg.