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
No apparent way to pickle a model from vowpalwabbit.sklearn_vw.VWClassifier #1040
Comments
I am not using the Scikit wrapper but just the Python one. For sure, pickle and assimilated doesn't work. Hope it helps. |
#1052 adds save and load methods for the sklearn interface as an alternative to the f option. I was thinking it might be helpful to use sphinx to autogenerate api docs for the python build. Is that the kind of documentation that would be helpful? |
1052 is in, so closing for now. Better documentation is very welcome form anyone who can contribute. |
Is there any update on using pickle?
However, even with the "-f" option stated above, the originally mentioned 'Pickling of "vowpalwabbit.pyvw.vw" instances is not enabled' error appears. Same holds for cloudpickle which e.g. joblib uses for serialization. Are there any suggested ways to run VowpalWabbit models in multiple python processes? |
@gramhagen did you enable pickling in the PR you just submitted? (#2368) |
yes, you can pickle the sklearn model, under the hood this is accomplished using
but the problem will persist here since this is passing the pyvw.vw object itself (which is not picklable) to each new process. So you need to encapsulate model creation in your dummy_train function and only pass the parameters you want to vary. example:
|
Pickling a fitted classifier gives you:
RuntimeError: Pickling of "vowpalwabbit.pyvw.vw" instances is not enabled (http://www.boost.org/libs/python/doc/v2/pickle.html)
Means I basically need to build the classifier at runtime every time to do actual prediction (or, I suppose, use CRIU).
The text was updated successfully, but these errors were encountered: