.\" Text automatically generated by txt2man .TH mlpack_lsh 1 "12 December 2020" "mlpack-3.4.2" "User Commands" .SH NAME \fBmlpack_lsh \fP- k-approximate-nearest-neighbor search with lsh .SH SYNOPSIS .nf .fam C \fBmlpack_lsh\fP [\fB-B\fP \fIint\fP] [\fB-H\fP \fIdouble\fP] [\fB-m\fP \fIunknown\fP] [\fB-k\fP \fIint\fP] [\fB-T\fP \fIint\fP] [\fB-K\fP \fIint\fP] [\fB-q\fP \fIstring\fP] [\fB-r\fP \fIstring\fP] [\fB-S\fP \fIint\fP] [\fB-s\fP \fIint\fP] [\fB-L\fP \fIint\fP] [\fB-t\fP \fIstring\fP] [\fB-V\fP \fIbool\fP] [\fB-d\fP \fIstring\fP] [\fB-n\fP \fIstring\fP] [\fB-M\fP \fIunknown\fP] [\fB-h\fP \fB-v\fP] .fam T .fi .fam T .fi .SH DESCRIPTION This program will calculate the k approximate-nearest-neighbors of a set of points using locality-sensitive hashing. 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. .PP For example, the following will return 5 neighbors from the data for each point in 'input.csv' and store the distances in 'distances.csv' and the neighbors in 'neighbors.csv': .PP $ \fBmlpack_lsh\fP \fB--k\fP 5 \fB--reference_file\fP input.csv \fB--distances_file\fP distances.csv \fB--neighbors_file\fP neighbors.csv .PP The output is organized such that row i and column j in the neighbors output corresponds to the index of the point in the reference set which is the j'th nearest neighbor from the point in the query set with index i. Row j and column i in the distances output file corresponds to the distance between those two points. .PP Because this is approximate-nearest-neighbors search, results may be different from run to run. Thus, the '\fB--seed\fP (\fB-s\fP)' parameter can be specified to set the random seed. .PP This program also has many other parameters to control its functionality; see the parameter-specific documentation for more information. .RE .PP .SH OPTIONAL INPUT OPTIONS .TP .B \fB--bucket_size\fP (\fB-B\fP) [\fIint\fP] The size of a bucket in the second level hash. Default value 500. .TP .B \fB--hash_width\fP (\fB-H\fP) [\fIdouble\fP] The hash width for the first-level hashing in the LSH preprocessing. By default, the LSH class automatically estimates a hash width for its use. Default value 0. .TP .B \fB--help\fP (\fB-h\fP) [\fIbool\fP] Default help info. .TP .B \fB--info\fP [\fIstring\fP] Print help on a specific option. Default value ''. .TP .B \fB--input_model_file\fP (\fB-m\fP) [\fIunknown\fP] Input LSH model. .TP .B \fB--k\fP (\fB-k\fP) [\fIint\fP] Number of nearest neighbors to find. Default value 0. .TP .B \fB--num_probes\fP (\fB-T\fP) [\fIint\fP] Number of additional probes for multiprobe LSH; if 0, traditional LSH is used. Default value 0. .TP .B \fB--projections\fP (\fB-K\fP) [\fIint\fP] The number of hash functions for each table Default value 10. .TP .B \fB--query_file\fP (\fB-q\fP) [\fIstring\fP] Matrix containing query points (optional). .TP .B \fB--reference_file\fP (\fB-r\fP) [\fIstring\fP] Matrix containing the reference dataset. .TP .B \fB--second_hash_size\fP (\fB-S\fP) [\fIint\fP] The size of the second level hash table. Default value 99901. .TP .B \fB--seed\fP (\fB-s\fP) [\fIint\fP] Random seed. If 0, 'std::time(NULL)' is used. Default value 0. .TP .B \fB--tables\fP (\fB-L\fP) [\fIint\fP] The number of hash tables to be used. Default value 30. .TP .B \fB--true_neighbors_file\fP (\fB-t\fP) [\fIstring\fP] Matrix of true neighbors to compute recall with (the recall is printed when \fB-v\fP is specified). .TP .B \fB--verbose\fP (\fB-v\fP) [\fIbool\fP] Display informational messages and the full list of parameters and timers at the end of execution. .TP .B \fB--version\fP (\fB-V\fP) [\fIbool\fP] Display the version of mlpack. .SH OPTIONAL OUTPUT OPTIONS .TP .B \fB--distances_file\fP (\fB-d\fP) [\fIstring\fP] Matrix to output distances into. .TP .B \fB--neighbors_file\fP (\fB-n\fP) [\fIstring\fP] Matrix to output neighbors into. .TP .B \fB--output_model_file\fP (\fB-M\fP) [\fIunknown\fP] Output for trained LSH model. .SH ADDITIONAL INFORMATION 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.