Open bjkomer opened 7 years ago
I have the same error
I have the same problem. Is there a way to fix this?
I am having exactly the same issue. Is this issue fixed yet?
I also have this error, but not consistently. Sometimes quitting python and then re-running in a fresh session means the same code doesn't fail.
Something like this:
... estim = HyperoptEstimator( classifier=clf, trial_timeout=1) estim.fit(X_train, y_train)
Results in this error:
AttributeError: 'hyperopt_estimator' object has no attribute '_best_preprocs'
Reinstall using: pip install networkx==1.11, can solve that problem
I`m working with this library for the past few days, and this problem comes when there is not any trial with STATUS_OK (produced by the short timeout), so when collecting the candidates, the list remains empty. I've edited the /.local/lib/python3.6/site-packages/hyperopt/base.py file approximately at line 500 like this:
`def best_trial(self):
candidates = [t for t in self.trials
if t['result']['status'] == STATUS_OK]
#losses = [float(t['result']['loss']) for t in candidates]
if not candidates: #en caso de que el primero no tenga STATUS_OK
losses = [1.0]
print('Loss of this itteration is: {} (it does not converge...)'.format(losses))
return self.trials[0]
else:
losses = [float(t['result']['loss']) for t in candidates]
print('Last STATUS_OK loss: {}'.format(losses[-1]))
best = np.argmin(losses)
return candidates[best]`
This way the program does not crash while there is almost one valid trial.
Something like this:
Results in this error:
AttributeError: 'hyperopt_estimator' object has no attribute '_best_preprocs'