We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
BaselineOnly
Most algorithms cannot be pickled/dumped (only BaselineOnly can and is actually tested). This is because Cython does not provide trivial pickling.
In test_dump.py, replace BaselineOnly by KNNBasic for instance.
test_dump.py
KNNBasic
The test_dump test in test_dump.py should pass when used with others algorithms than BaselineOnly.
test_dump
========================================================================================================================================================================================================================================== FAILURES ========================================================================================================================================================================================================================================== _________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ test_dump __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ u1_ml100k = <surprise.dataset.DatasetUserFolds object at 0x10583f250> def test_dump(u1_ml100k): """Train an algorithm, compute its predictions then dump them. Ensure that the predictions that are loaded back are the correct ones, and that the predictions of the dumped algorithm are also equal to the other ones.""" random.seed(0) trainset, testset = next(PredefinedKFold().split(u1_ml100k)) algo = KNNBasic() algo.fit(trainset) predictions = algo.test(testset) with tempfile.NamedTemporaryFile() as tmp_file: > dump.dump(tmp_file.name, predictions, algo) tests/test_dump.py:26: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ venv/lib/python3.9/site-packages/scikit_surprise-1.1.2-py3.9-macosx-10.9-universal2.egg/surprise/dump.py:28: in dump pickle.dump(dump_obj, open(file_name, "wb"), protocol=pickle.HIGHEST_PROTOCOL) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E TypeError: no default __reduce__ due to non-trivial __cinit__
macOS-12.5-arm64-arm-64bit
Python 3.9.13 (v3.9.13:6de2ca5339, May 17 2022, 11:37:23) [Clang 13.0.0 (clang-1300.0.29.30)]
surprise 1.1.2
The text was updated successfully, but these errors were encountered:
I released 1.1.3 this weekend with a bugfix. Please feel free to reopen an issue if you still have problems with 1.1.3.
Sorry, something went wrong.
Thank you, I did it differently in a PR where I translate typed memory views to numpy arrays back and forth, but it's too late I assume :-)
No branches or pull requests
Description
Most algorithms cannot be pickled/dumped (only
BaselineOnly
can and is actually tested). This is because Cython does not provide trivial pickling.Steps/Code to Reproduce
In
test_dump.py
, replaceBaselineOnly
byKNNBasic
for instance.Expected Results
The
test_dump
test intest_dump.py
should pass when used with others algorithms thanBaselineOnly
.Actual Results
Versions
macOS-12.5-arm64-arm-64bit
Python 3.9.13 (v3.9.13:6de2ca5339, May 17 2022, 11:37:23)
[Clang 13.0.0 (clang-1300.0.29.30)]
surprise 1.1.2
The text was updated successfully, but these errors were encountered: