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

The k returned neighbors have to be distinct, that's the reasonable 
expectation of a user of the package.

I'm sorry, I can't put in the time right now to read the current code 
and think about how to do it elegantly.

Daniel

On 10/22/2014 12:30 PM, jnothman 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],
>
> Your approach should suffice though. Do we need the arbitrary candidates
> to be distinct?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/scikit-learn/scikit-learn/pull/3304/files#r19204847>.
>