mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-01-20 05:50:36 +00:00
early stop - replace values lower than 20 with 20 and display a warning.
This commit is contained in:
@@ -490,7 +490,7 @@ freqtrade hyperopt --config config.json --hyperopt-loss <hyperoptlossname> --str
|
||||
```
|
||||
|
||||
The `-e` option will set how many evaluations hyperopt will do. Since hyperopt uses Bayesian search, running too many epochs at once may not produce greater results. Experience has shown that best results are usually not improving much after 500-1000 epochs.
|
||||
The `--early-stop` option will set after how many epochs with no improvements hyperopt will stop. A good value is 20-30% of the total epochs. Early stop is by default disabled (`--early-stop=0`)
|
||||
The `--early-stop` option will set after how many epochs with no improvements hyperopt will stop. A good value is 20-30% of the total epochs. Any value greater than 0 and lower than 20 it will be replaced by 20. Early stop is by default disabled (`--early-stop=0`)
|
||||
|
||||
Doing multiple runs (executions) with a few 1000 epochs and different random state will most likely produce different results.
|
||||
|
||||
|
||||
@@ -334,8 +334,16 @@ class Configuration:
|
||||
("print_all", "Parameter --print-all detected ..."),
|
||||
]
|
||||
self._args_to_config_loop(config, configurations)
|
||||
if self.args.get("early_stop", 0) > 0:
|
||||
config.update({"early_stop": self.args["early_stop"]})
|
||||
es_epochs = self.args.get("early_stop", 0)
|
||||
if es_epochs > 0:
|
||||
if es_epochs < 20:
|
||||
logger.warning(
|
||||
f"Early stop epochs {es_epochs} lower than 20. "
|
||||
f"It will be replaced with 20."
|
||||
)
|
||||
config.update({"early_stop": 20})
|
||||
else:
|
||||
config.update({"early_stop": self.args["early_stop"]})
|
||||
logger.info(
|
||||
f"Parameter --early-stop detected ... Will early stop hyperopt if no improvement "
|
||||
f"after {self.args.get('early_stop')} epochs ..."
|
||||
|
||||
Reference in New Issue
Block a user