[MRG] Locality Sensitive Hashing for approximate nearest neighbor search(GSoC)

The contract with the user is that in the end we must return k "neighbors"
that actually exist in the DB, so the best k out of 5k random candidates is
a valid, if sucky, answer. How do dud infinite-distance candidates help us?
maybe I am not understanding exactly what you mean.

On Wed, Oct 22, 2014 at 12:04 PM, jnothman <notifications@github.com> wrote:

> In sklearn/neighbors/approximate.py:
>
> > +        hashes = (grp.transform(self._fit_X) > 0).astype(int)
> > +        hash_function = grp.components_
> > +
> > +        binary_hashes = np.packbits(hashes).view(dtype='>u4')
> > +        original_indices = np.argsort(binary_hashes)
> > +
> > +        return original_indices, binary_hashes[original_indices], hash_function
> > +
> > +    def _compute_distances(self, query, candidates):
> > +        """Computes the cosine distance.
> > +
> > +        Distance is from the query to points in the candidates array.
> > +        Returns argsort of distances in the candidates
> > +        array and sorted distances.
> > +        """
> > +        distances = pairwise_distances(query, self._fit_X[candidates],
>
> Why do you prefer random candidates over dud infinite-distance candidates?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/scikit-learn/scikit-learn/pull/3304/files#r19203950>.
>



-- 
Daniel Vainsencher