You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
~/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py in _unpickle(fobj, filename, mmap_mode)
506 obj = None
507 try:
--> 508 obj = unpickler.load()
509 if unpickler.compat_mode:
510 warnings.warn("The file '%s' has been generated with a "
I am trying to persist with joblib several EvolutionarySearchCV objects.
I have used this code:
`ev_search = []
it = 0
import warnings
import time
from sklearn.externals import joblib
t0 = time.time()
with warnings.catch_warnings():
warnings.simplefilter("ignore")
for n, mod, par in zip(names, mods, params):
print('Estimating ', n ,'...', sep='')
ev = EvolutionaryAlgorithmSearchCV(estimator=mod,
params=par,
scoring="roc_auc",
cv=kf,
verbose=0,
population_size=100,
gene_mutation_prob=0.10,
gene_crossover_prob=0.5,
tournament_size=3,
generations_number=10,
n_jobs=4)
ev.fit(X_train, y_train)
ev_search.append(ev)
#with open('./models_final/evv_' + n + '.pkl', 'wb') as f:
# pickle.dump(ev, f)
joblib.dump(ev, ('./models_final/evv_' + n + '.pkl'))
#print('Time elapsed:', str(t0 - time.time()))
print('Saved ', n ,' to disk', sep='')
print('----------------')
print('')
`
When I try to load it
x = joblib.load('./models_final/evv_XGBoost.pkl')
I get this error:
`---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in ()
----> 1 x = joblib.load('./models_final/evv_XGBoost.pkl')
~/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py in load(filename, mmap_mode)
576 return load_compatibility(fobj)
577
--> 578 obj = _unpickle(fobj, filename, mmap_mode)
579
580 return obj
~/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/numpy_pickle.py in _unpickle(fobj, filename, mmap_mode)
506 obj = None
507 try:
--> 508 obj = unpickler.load()
509 if unpickler.compat_mode:
510 warnings.warn("The file '%s' has been generated with a "
~/anaconda3/lib/python3.6/pickle.py in load(self)
1048 raise EOFError
1049 assert isinstance(key, bytes_types)
-> 1050 dispatchkey[0]
1051 except _Stop as stopinst:
1052 return stopinst.value
~/anaconda3/lib/python3.6/pickle.py in load_global(self)
1336 module = self.readline()[:-1].decode("utf-8")
1337 name = self.readline()[:-1].decode("utf-8")
-> 1338 klass = self.find_class(module, name)
1339 self.append(klass)
1340 dispatch[GLOBAL[0]] = load_global
~/anaconda3/lib/python3.6/pickle.py in find_class(self, module, name)
1390 return _getattribute(sys.modules[module], name)[0]
1391 else:
-> 1392 return getattr(sys.modules[module], name)
1393
1394 def load_reduce(self):
AttributeError: module 'deap.creator' has no attribute 'Individual'`
The text was updated successfully, but these errors were encountered: