Import error rand_score
Using the following code:
from sklearn.metrics import rand_score (which is what is required per scikit-learn.org
I get error
--------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-187-d43b243c5958> in <module> ----> 1 from sklearn.metrics import rand_score ImportError: cannot import name 'rand_score'
I have spoken to others who are now telling me that I am using an old version of sklearn. The last version that is stable is 1.1.3 and when I tried to add that to my env it would let me go past .22
I am using python 3.6
Operating system used: macOS
Answers
-
Hi,
If you are defining a custom metric from the visual ML interface of Dataiku then you are indeed using an older version of scikit-learn.
That being said, you should still be able to compute your metric by using
sklearn.metrics.adjusted_rand_score
(doc).Hope this helps.
Best,
Harizo
-
Yes, I can use adjusted but they are two different measurements.
I have a code environment that I set up for running python in Dataiku. This is a list of the packages installed. When I try to install any new packages that are stable I get error telling me they are not available. I have not been able to install any newer packages.
-
Hi,
What is the exact error message that you get when trying to install the code env packages?
-
ImportError Traceback (most recent call last) <ipython-input-187-d43b243c5958> in <module> ----> 1 from sklearn.metrics import rand_score ImportError: cannot import name 'rand_score'