8000 test_metrics fails in Python 3.3 · Issue #1811 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

test_metrics fails in Python 3.3 #1811

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

Closed
kmike opened this issue Mar 26, 2013 · 6 comments
Closed

test_metrics fails in Python 3.3 #1811

kmike opened this issue Mar 26, 2013 · 6 comments

Comments

@kmike
Copy link
Contributor
kmike commented Mar 26, 2013

Many tests from test_metrics fails in Python 3.3.

I think some of them fails because of stdlib "random" module changes: given the same seed, random.shuffle produces different results in Python >= 3.3 and Python < 3.3, and test_metrics.make_prediction relies on random.seed(0) to get reproducible random.shuffle.

@larsmans
Copy link
Member

I guess we should use np.random.shuffle then?

@amueller
Copy link
Member

Wait, there is non-reproducable shuffling? Or is it just not the same shuffling that was giving previously?

@kmike
Copy link
Contributor Author
kmike commented Mar 31, 2013

It is just not the same in Python < 3.3 and Python >= 3.3.

@amueller
Copy link
Member

Maybe we shouldn't rely on the outcome in the tests? I always feel that is a bit odd.

@larsmans
Copy link
Member
larsmans commented Apr 1, 2013

Tried to fix the issue by turning to check_random_state to get PRNGs (but the test outcomes are still hardcoded). Please test this, I don't have Py3.3 installed.

@larsmans larsmans reopened this Apr 1, 2013
@kmike
Copy link
Contributor Author
kmike commented Apr 1, 2013

test_metrics.py now pass with Python 3.3, thanks!

@kmike kmike closed this as completed Apr 1, 2013
larsmans added a commit that referenced this issue Jul 18, 2013
Random number generator changes per Python 3.3.
Also, don't use unseeded np.random. Should fix #1811.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0