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.
As of January 2020, do something like the following instead...
from surprise import SVD
from surprise import Dataset
from surprise.model_selection import cross_validate
# Load the dataset (download it if needed)
data = Dataset.load_builtin('ml-100k')
# Use the famous SVD algorithm
algo = SVD()
# Run 5-fold cross-validation and then print results
cross_validate(algo, data, measures=['RMSE', 'MAE'], cv=5, verbose=True)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With