I need to store a machine learning classifier that I developed using sklearn. I am using joblib package for this. Here is how I do it:
from sklearn.externals improt joblib
#clf is defined above
joblib.dump(clf,'test.clf')
I am having the following error:
Traceback (most recent call last):
File "svm_clf.py", line 333, in <module>
my_svm_classifier(get_best_model(), X, y, name="svm pos vs neg", plot=True)
File "svm_clf.py", line 300, in my_svm_classifier
joblib.dump(clf, 'neg.clf')
File "//anaconda/lib/python2.7/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 369, in dump pickler.dump(value)
...
...
...
pickle.PicklingError: Can't pickle <function preprocessor at 0x108301488>: it's not found as \__main\__.preprocessor
Any help?