Readded things

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

View File

@ -33,8 +33,11 @@ from user_data.hyperopt_conf import hyperopt_optimize_conf
class Testz(): class Testz():
MongoTrials('mongo://127.0.0.1:1234/freqtrade_hyperopt/jobs') db_name = 'freqtrade_hyperopt'
MongoTrials(
arg='mongo://127.0.0.1:1234/{}/jobs'.format(db_name),
exp_key='exp1'
)
class Hyperopt(Backtesting): class Hyperopt(Backtesting):
@ -542,14 +545,20 @@ class Hyperopt(Backtesting):
space=self.hyperopt_space(), space=self.hyperopt_space(),
algo=tpe.suggest, algo=tpe.suggest,
max_evals=self.total_tries, max_evals=self.total_tries,
trials=MongoTrials('mongo://127.0.0.1:1234/freqtrade_hyperopt/jobs') 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() 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
except ValueError:
best_parameters = {}
best_result = 'Sorry, Hyperopt was not able to find good parameters. Please ' \
'try with more epochs (param: -e).'
if best_parameters: if best_parameters:
best_parameters = space_eval( best_parameters = space_eval(
self.hyperopt_space(), self.hyperopt_space(),