我需要存储我使用sklearn开发的机器学习分类器。我正在使用joblib包。我是这样做的:
from sklearn.externals improt joblib
#clf is defined above
joblib.dump(clf,'test.clf')
我遇到以下错误:
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
任何帮助?