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

Missing sklearn modules #4

Open
rravenel opened this issue Jun 9, 2022 · 1 comment
Open

Missing sklearn modules #4

rravenel opened this issue Jun 9, 2022 · 1 comment

Comments

@rravenel
Copy link

rravenel commented Jun 9, 2022

MacOS Monterey 12.2.1
I'm using current stable sklearn (1.1.1), Python 3.8.9. I hit the following errors:

File "/Users/rene/.venv/ahead2/lib/python3.8/site-packages/SOMperf-0.2b0-py3.8.egg/somperf/metrics/external.py", line 6, in
ModuleNotFoundError: No module named 'sklearn.metrics.cluster.supervised'

somperf/metrics/external.py, line 6: from sklearn.metrics.cluster.supervised import check_clusterings

I managed to find sklearn source here (0.17.1): https://gemfury.com/stream/python:scikit-learn/-/content/metrics/cluster/supervised.py; pasted the check_clusterings definition into external.py, reinstalled and then hit the following:

File "/Users/rene/.venv/ahead2/lib/python3.8/site-packages/SOMperf-0.2b0-py3.8.egg/somperf/metrics/external.py", line 7, in
ModuleNotFoundError: No module named 'sklearn.utils.linear_assignment_'

sklearn 0.17.1 won't build on my machine. 0.22.2 doesn't have these problems, but consistently segfaults.

Please add version numbers to requirements.txt (and maybe reply here with them, too).

Thank you.

@hbanderier
Copy link

Hi, just stumbled upon this and maybe it can help people in the future / be fixed in the main branch
I fixed these issues by replacing the sklearn imports in external.py by

from sklearn.metrics.cluster._supervised import check_clusterings
from scipy.optimize import linear_sum_assignment as linear_assignment

Hope it helps !

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

2 participants