1. A method of modeling a cost associated with executing locality-sensitive hashing (LSH) on a query vector and a set of data vectors, wherein the LSH is parameterized by a number of projections m, a quantization factor w, and a number of repetitions L; and hashes a vector to a collection of buckets; the method comprising: computing, based on m, a first cost of hashing the query vector into a collection of buckets; computing, based on L, a second cost of searching the data vectors in the union of the buckets; determining a sum of the first cost and the second cost; and setting one or more parameters of the LSH based on the determined cost.