Update hyperopt.py

This commit is contained in:
MoonGem 2018-03-23 00:33:59 -05:00 committed by GitHub
parent c396cf0dcb
commit 12750cb765
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -538,8 +538,7 @@ class Hyperopt(Backtesting):
self.current_tries, self.current_tries,
self.total_tries self.total_tries
) )
try:
def Tests():
best_parameters = fmin( best_parameters = fmin(
fn=self.generate_optimizer, fn=self.generate_optimizer,
space=self.hyperopt_space(), space=self.hyperopt_space(),
@ -547,11 +546,8 @@ class Hyperopt(Backtesting):
max_evals=self.total_tries, max_evals=self.total_tries,
trials=MongoTrials(arg='mongo://127.0.0.1:1234/freqtrade_hyperopt/jobs', exp_key='exp1') trials=MongoTrials(arg='mongo://127.0.0.1:1234/freqtrade_hyperopt/jobs', exp_key='exp1')
) )
return best_parameters
try:
# change the Logging format # change the Logging format
self.logging.set_format('\n%(message)s') self.logging.set_format('\n%(message)s')
best_parameters = Tests()
results = sorted(self.trials.results, key=itemgetter('loss')) results = sorted(self.trials.results, key=itemgetter('loss'))
best_result = results[0]['result'] best_result = results[0]['result']
# Improve best parameter logging display # Improve best parameter logging display