# For example, the following will return 5 neighbors from the data for each
# point in "input" and store the distances in "distances" and the neighbors
# in "neighbors":
if (FALSE) {
output <- lsh(k=5, reference=input)
distances <- output$distances
neighbors <- output$neighbors
}
# 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.
#
# Because this is approximate-nearest-neighbors search, results may be
# different from run to run. Thus, the "seed" parameter can be specified to
# set the random seed.
#
# This program also has many other parameters to control its functionality;
# see the parameter-specific documentation for more information.
Run the code above in your browser using DataLab