Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAIL: Doctest: sklearn.neighbors.approximate.LSHForest #5324

Closed
cosmos2006 opened this issue Sep 28, 2015 · 4 comments
Closed

FAIL: Doctest: sklearn.neighbors.approximate.LSHForest #5324

cosmos2006 opened this issue Sep 28, 2015 · 4 comments
Labels
Bug Easy Well-defined and straightforward way to resolve
Milestone

Comments

@cosmos2006
Copy link

while buidling the scikit.learn, I encountered following error. Please have a look at it.

Regards
cosmos

FAIL: Doctest: sklearn.neighbors.approximate.LSHForest
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python2.7/doctest.py", line 2201, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for sklearn.neighbors.approximate.LSHForest
  File "/usr/local/scikit-learn-master/sklearn/neighbors/approximate.py", line 110, in LSHForest

----------------------------------------------------------------------
File "/usr/local/scikit-learn-master/sklearn/neighbors/approximate.py", line 198, in sklearn.neighbors.approximate.LSHForest
Failed example:
    distances                                        # doctest: +ELLIPSIS
Expected:
    array([[ 0.069...,  0.149...],
           [ 0.229...,  0.481...],
           [ 0.004...,  0.014...]])
Got:
    array([[ 0.0693931 ,  0.14960959],
           [ 0.22932536,  0.49225586],
           [ 0.00489444,  0.01481913]])
----------------------------------------------------------------------
File "/usr/local/scikit-learn-master/sklearn/neighbors/approximate.py", line 202, in sklearn.neighbors.approximate.LSHForest
Failed example:
@amueller amueller added the Bug label Oct 13, 2015
@amueller amueller added this to the 0.17 milestone Oct 13, 2015
@amueller
Copy link
Member

I haven't seen this one before.
I think we should set the random_state in the docstring or ignore the output. I'm not super familiar with the LSHForest. Actually I wonder how this test ever passed without setting the random_state. Ping @ogrisel @jnothman?
The result can vary widely, depending on the random state, so setting the precision differently is not really an option.

@jnothman
Copy link
Member

Oh! Apparently this example is reporting the exact nearest neighbors due to very generous parameters (n_candidates, n_estimators are both high with respect to the tiny data). We should be reducing the parameters and fixing random_state.

@jnothman jnothman added Easy Well-defined and straightforward way to resolve Need Contributor labels Oct 13, 2015
@amueller
Copy link
Member

"mostly" providing the nearest neighbors. It's not deterministic on my box.

@lesteve you wanna fix this one up for the release?

@lesteve
Copy link
Member

lesteve commented Oct 15, 2015

@lesteve you wanna fix this one up for the release?

I can try to have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Easy Well-defined and straightforward way to resolve
Projects
None yet
Development

No branches or pull requests

4 participants