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

$ pep8 test_approximate.py
test_approximate.py:45:33: E225 missing whitespace around operator
test_approximate.py:48:38: E225 missing whitespace around operator
test_approximate.py:76:33: E225 missing whitespace around operator
test_approximate.py:79:38: E225 missing whitespace around operator
test_approximate.py:259:68: E225 missing whitespace around operator

The instance: "intersection/float(n_neighbors)" happens on line 45.

Maybe you have this hint configured away?

Daniel

On 08/16/2014 06:36 PM, Maheshakya Wijewardena wrote:
> In examples/neighbors/plot_approximate_nearest_neighbors.py:
>
>> +# Calculate average accuracy for each value of `n_estimators`
>> +for i, n_estimators in enumerate(n_estimators_values):
>> +    lshf = LSHForest(n_candidates=500, n_estimators=n_estimators,
>> +                     n_neighbors=n_neighbors)
>> +    nbrs = NearestNeighbors(n_neighbors=n_neighbors)
>> +
>> +    lshf.fit(X)
>> +    nbrs.fit(X)
>> +    for j in range(n_iter):
>> +        query = X[rng.randint(0, n_samples)]
>> +        neighbors_approx = lshf.kneighbors(query, return_distance=False)
>> +        neighbors_exact = nbrs.kneighbors(query, return_distance=False)
>> +
>> +        intersection = np.intersect1d(neighbors_approx,
>> +                                      neighbors_exact).shape[0]
>> +        ratio = intersection/float(n_neighbors)
>
> I fixed all pep8 error earlier. Ran the pep8 tool again on this file,
> but did not get any errors. :(
> Can you point out a place where an error occurs?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/scikit-learn/scikit-learn/pull/3304/files#r16325294>.
>