Hi everyone,
I have run a model in a Jupyter notebook :
params = {'C' : [0.1,1,10], 'kernel' : ['rbf', 'linear']}
# Entrainement
svc = OneVsRestClassifier(GridSearchCV(SVC(), params))
svc.fit(X_train, y_train)
And then, since I'm happy with the result and it was pretty loooooong to run, I use joblib to be able to use it after:
file_svc = 'fit_SVM'
joblib.dump(svc, file_svc)
Until there everything works just fine. To use it afterwards and transform new data, here is what I do:
svc = joblib.load('OC-Projet-6/fit_SVM')
y_sup = svc.predict(X_sup)
This was the code (with path) I use in the Jupyter Notebook and it works perfectly. But when I try this in PythonAnywhere, I get an AttributeError:
svc = joblib.load('fit_SVM')
y_sup = svc.predict(X_sup)
Error doesn't come from the path (I do other joblib.load and this is the only one which leads to an error). Here is the message I get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/AMarnier/mysite/modele.py", line 60, in tag_proposal
svc = joblib.load('fit_SVM')
File "/home/AMarnier/.local/lib/python3.6/site-packages/joblib/numpy_pickle.py", line 596, in load
obj = _unpickle(fobj, filename, mmap_mode)
File "/home/AMarnier/.local/lib/python3.6/site-packages/joblib/numpy_pickle.py", line 524, in _unpickle
obj = unpickler.load()
File "/usr/lib/python3.6/pickle.py", line 1050, in load
dispatch[key[0]](self)
File "/usr/lib/python3.6/pickle.py", line 1338, in load_global
klass = self.find_class(module, name)
File "/usr/lib/python3.6/pickle.py", line 1392, in find_class
return getattr(sys.modules[module], name)
AttributeError: module 'sklearn.utils.deprecation' has no attribute 'DeprecationDict'
Does anyone has an idea of what causes the issue ? Thanks for your help.
Andréa