Search code examples
python-3.xscikit-learnanacondarecommendation-engine

ImportError: cannot import name 'evaluate' ( from surprise import evaluate )


from surprise import Reader, Dataset, SVD
from surprise import evaluate
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-12-6d771df269b8> in <module>()
----> 1 from surprise import evaluate

ImportError: cannot import name 'evaluate'

The first line, from surprise import Reader, Dataset, SVD works fine. Just that, it's not able to import the evaluate from the surprise package.

I have installed the scikit-surprise using conda. I think it was installed successfully.


Solution

  • According to the documentation, the evaluate() method was deprecated in version 1.0.5 (functionally replaced by model_selection.cross_validate()) and was removed in version 1.1.0, which is likely what you have installed.