Remove hyperopt --continue
This commit is contained in:
parent
64c2b6c9a6
commit
b736691e0e
@ -26,7 +26,7 @@ ARGS_HYPEROPT = ARGS_COMMON_OPTIMIZE + ["hyperopt", "hyperopt_path",
|
|||||||
"use_max_market_positions", "print_all",
|
"use_max_market_positions", "print_all",
|
||||||
"print_colorized", "print_json", "hyperopt_jobs",
|
"print_colorized", "print_json", "hyperopt_jobs",
|
||||||
"hyperopt_random_state", "hyperopt_min_trades",
|
"hyperopt_random_state", "hyperopt_min_trades",
|
||||||
"hyperopt_continue", "hyperopt_loss"]
|
"hyperopt_loss"]
|
||||||
|
|
||||||
ARGS_EDGE = ARGS_COMMON_OPTIMIZE + ["stoploss_range"]
|
ARGS_EDGE = ARGS_COMMON_OPTIMIZE + ["stoploss_range"]
|
||||||
|
|
||||||
|
@ -252,13 +252,6 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
metavar='INT',
|
metavar='INT',
|
||||||
default=1,
|
default=1,
|
||||||
),
|
),
|
||||||
"hyperopt_continue": Arg(
|
|
||||||
"--continue",
|
|
||||||
help="Continue hyperopt from previous runs. "
|
|
||||||
"By default, temporary files will be removed and hyperopt will start from scratch.",
|
|
||||||
default=False,
|
|
||||||
action='store_true',
|
|
||||||
),
|
|
||||||
"hyperopt_loss": Arg(
|
"hyperopt_loss": Arg(
|
||||||
'--hyperopt-loss',
|
'--hyperopt-loss',
|
||||||
help='Specify the class name of the hyperopt loss function class (IHyperOptLoss). '
|
help='Specify the class name of the hyperopt loss function class (IHyperOptLoss). '
|
||||||
|
@ -295,9 +295,6 @@ class Configuration:
|
|||||||
self._args_to_config(config, argname='hyperopt_min_trades',
|
self._args_to_config(config, argname='hyperopt_min_trades',
|
||||||
logstring='Parameter --min-trades detected: {}')
|
logstring='Parameter --min-trades detected: {}')
|
||||||
|
|
||||||
self._args_to_config(config, argname='hyperopt_continue',
|
|
||||||
logstring='Hyperopt continue: {}')
|
|
||||||
|
|
||||||
self._args_to_config(config, argname='hyperopt_loss',
|
self._args_to_config(config, argname='hyperopt_loss',
|
||||||
logstring='Using Hyperopt loss class name: {}')
|
logstring='Using Hyperopt loss class name: {}')
|
||||||
|
|
||||||
|
@ -86,10 +86,7 @@ class Hyperopt:
|
|||||||
|
|
||||||
self.current_best_loss = 100
|
self.current_best_loss = 100
|
||||||
|
|
||||||
if not self.config.get('hyperopt_continue'):
|
self.clean_hyperopt()
|
||||||
self.clean_hyperopt()
|
|
||||||
else:
|
|
||||||
logger.info("Continuing on previous hyperopt results.")
|
|
||||||
|
|
||||||
self.num_epochs_saved = 0
|
self.num_epochs_saved = 0
|
||||||
|
|
||||||
|
@ -839,17 +839,6 @@ def test_clean_hyperopt(mocker, hyperopt_conf, caplog):
|
|||||||
assert log_has(f"Removing `{h.data_pickle_file}`.", caplog)
|
assert log_has(f"Removing `{h.data_pickle_file}`.", caplog)
|
||||||
|
|
||||||
|
|
||||||
def test_continue_hyperopt(mocker, hyperopt_conf, caplog):
|
|
||||||
patch_exchange(mocker)
|
|
||||||
hyperopt_conf.update({'hyperopt_continue': True})
|
|
||||||
mocker.patch("freqtrade.optimize.hyperopt.Path.is_file", MagicMock(return_value=True))
|
|
||||||
unlinkmock = mocker.patch("freqtrade.optimize.hyperopt.Path.unlink", MagicMock())
|
|
||||||
Hyperopt(hyperopt_conf)
|
|
||||||
|
|
||||||
assert unlinkmock.call_count == 0
|
|
||||||
assert log_has("Continuing on previous hyperopt results.", caplog)
|
|
||||||
|
|
||||||
|
|
||||||
def test_print_json_spaces_all(mocker, hyperopt_conf, capsys) -> None:
|
def test_print_json_spaces_all(mocker, hyperopt_conf, capsys) -> None:
|
||||||
dumper = mocker.patch('freqtrade.optimize.hyperopt.dump', MagicMock())
|
dumper = mocker.patch('freqtrade.optimize.hyperopt.dump', MagicMock())
|
||||||
mocker.patch('freqtrade.optimize.backtesting.Backtesting.load_bt_data',
|
mocker.patch('freqtrade.optimize.backtesting.Backtesting.load_bt_data',
|
||||||
|
Loading…
Reference in New Issue
Block a user