mlpack_krann(1) | User Commands | mlpack_krann(1) |
mlpack_krann - k-rank-approximate-nearest-neighbors (krann)
mlpack_krann [-a double] [-X bool] [-m unknown] [-k int] [-l int] [-N bool] [-q string] [-R bool] [-r string] [-L bool] [-s int] [-S bool] [-z int] [-T double] [-t string] [-V bool] [-d string] [-n string] [-M unknown] [-h -v]
This program will calculate the k rank-approximate-nearest-neighbors of a set of points. You may specify a separate set of reference points and query points, or just a reference set which will be used as both the reference and query set. You must specify the rank approximation (in %) (and optionally the success probability).
For example, the following will return 5 neighbors from the top 0.1% of the data (with probability 0.95) for each point in 'input.csv' and store the distances in 'distances.csv' and the neighbors in 'neighbors.csv.csv':
$ krann --reference_file input.csv --k 5 --distances_file distances.csv --neighbors_file neighbors.csv --tau 0.1
Note that tau must be set such that the number of points in the corresponding percentile of the data is greater than k. Thus, if we choose tau = 0.1 with a dataset of 1000 points and k = 5, then we are attempting to choose 5 nearest neighbors out of the closest 1 point -- this is invalid and the program will terminate with an error message.
The output matrices are organized such that row i and column j in the neighbors output file corresponds to the index of the point in the reference set which is the i'th nearest neighbor from the point in the query set with index j. Row i and column j in the distances output file corresponds to the distance between those two points.
For further information, including relevant papers, citations, and theory, consult the documentation found at http://www.mlpack.org or included with your distribution of mlpack.
18 November 2018 | mlpack-3.0.4 |