Merge branch 'develop' into fix/multioutput-bug
This commit is contained in:
		| @@ -79,8 +79,7 @@ | |||||||
|             "test_size": 0.33, |             "test_size": 0.33, | ||||||
|             "random_state": 1 |             "random_state": 1 | ||||||
|         }, |         }, | ||||||
|         "model_training_parameters": { |         "model_training_parameters": {} | ||||||
|         } |  | ||||||
|     }, |     }, | ||||||
|     "bot_name": "", |     "bot_name": "", | ||||||
|     "force_entry_enable": true, |     "force_entry_enable": true, | ||||||
|   | |||||||
| @@ -26,10 +26,7 @@ FreqAI is configured through the typical [Freqtrade config file](configuration.m | |||||||
|         }, |         }, | ||||||
|         "data_split_parameters" : { |         "data_split_parameters" : { | ||||||
|             "test_size": 0.25 |             "test_size": 0.25 | ||||||
|         }, |         } | ||||||
|         "model_training_parameters" : { |  | ||||||
|             "n_estimators": 100 |  | ||||||
|         }, |  | ||||||
|     } |     } | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
|   | |||||||
| @@ -355,6 +355,13 @@ def _validate_freqai_include_timeframes(conf: Dict[str, Any]) -> None: | |||||||
|                 f"Main timeframe of {main_tf} must be smaller or equal to FreqAI " |                 f"Main timeframe of {main_tf} must be smaller or equal to FreqAI " | ||||||
|                 f"`include_timeframes`.Offending include-timeframes: {', '.join(offending_lines)}") |                 f"`include_timeframes`.Offending include-timeframes: {', '.join(offending_lines)}") | ||||||
|  |  | ||||||
|  |         # Ensure that the base timeframe is included in the include_timeframes list | ||||||
|  |         if main_tf not in freqai_include_timeframes: | ||||||
|  |             feature_parameters = conf.get('freqai', {}).get('feature_parameters', {}) | ||||||
|  |             include_timeframes = [main_tf] + freqai_include_timeframes | ||||||
|  |             conf.get('freqai', {}).get('feature_parameters', {}) \ | ||||||
|  |                 .update({**feature_parameters, 'include_timeframes': include_timeframes}) | ||||||
|  |  | ||||||
|  |  | ||||||
| def _validate_freqai_backtest(conf: Dict[str, Any]) -> None: | def _validate_freqai_backtest(conf: Dict[str, Any]) -> None: | ||||||
|     if conf.get('runmode', RunMode.OTHER) == RunMode.BACKTEST: |     if conf.get('runmode', RunMode.OTHER) == RunMode.BACKTEST: | ||||||
|   | |||||||
| @@ -608,9 +608,8 @@ CONF_SCHEMA = { | |||||||
|                 "backtest_period_days", |                 "backtest_period_days", | ||||||
|                 "identifier", |                 "identifier", | ||||||
|                 "feature_parameters", |                 "feature_parameters", | ||||||
|                 "data_split_parameters", |                 "data_split_parameters" | ||||||
|                 "model_training_parameters" |             ] | ||||||
|                 ] |  | ||||||
|         }, |         }, | ||||||
|     }, |     }, | ||||||
| } | } | ||||||
|   | |||||||
| @@ -61,7 +61,7 @@ class ReinforcementLearner(BaseReinforcementLearningModel): | |||||||
|             model = self.MODELCLASS(self.policy_type, self.train_env, policy_kwargs=policy_kwargs, |             model = self.MODELCLASS(self.policy_type, self.train_env, policy_kwargs=policy_kwargs, | ||||||
|                                     tensorboard_log=Path( |                                     tensorboard_log=Path( | ||||||
|                                         dk.full_path / "tensorboard" / dk.pair.split('/')[0]), |                                         dk.full_path / "tensorboard" / dk.pair.split('/')[0]), | ||||||
|                                     **self.freqai_info['model_training_parameters'] |                                     **self.freqai_info.get('model_training_parameters', {}) | ||||||
|                                     ) |                                     ) | ||||||
|         else: |         else: | ||||||
|             logger.info('Continual training activated - starting training from previously ' |             logger.info('Continual training activated - starting training from previously ' | ||||||
|   | |||||||
| @@ -1046,8 +1046,13 @@ def test__validate_freqai_include_timeframes(default_conf, caplog) -> None: | |||||||
|     # Validation pass |     # Validation pass | ||||||
|     conf.update({'timeframe': '1m'}) |     conf.update({'timeframe': '1m'}) | ||||||
|     validate_config_consistency(conf) |     validate_config_consistency(conf) | ||||||
|     conf.update({'analyze_per_epoch': True}) |  | ||||||
|  |  | ||||||
|  |     # Ensure base timeframe is in include_timeframes | ||||||
|  |     conf['freqai']['feature_parameters']['include_timeframes'] = ["5m", "15m"] | ||||||
|  |     validate_config_consistency(conf) | ||||||
|  |     assert conf['freqai']['feature_parameters']['include_timeframes'] == ["1m", "5m", "15m"] | ||||||
|  |  | ||||||
|  |     conf.update({'analyze_per_epoch': True}) | ||||||
|     with pytest.raises(OperationalException, |     with pytest.raises(OperationalException, | ||||||
|                        match=r"Using analyze-per-epoch .* not supported with a FreqAI strategy."): |                        match=r"Using analyze-per-epoch .* not supported with a FreqAI strategy."): | ||||||
|         validate_config_consistency(conf) |         validate_config_consistency(conf) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user