From 6c7d02cb18b9284522da420d4a54173d38778f46 Mon Sep 17 00:00:00 2001 From: robcaulk Date: Tue, 28 Jun 2022 15:12:25 +0200 Subject: [PATCH] expose nu in the SVM outlier detection via svm_nu in config --- freqtrade/freqai/data_kitchen.py | 5 +++-- freqtrade/freqai/freqai_interface.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/freqtrade/freqai/data_kitchen.py b/freqtrade/freqai/data_kitchen.py index 99b5024ed..7f3d80c5e 100644 --- a/freqtrade/freqai/data_kitchen.py +++ b/freqtrade/freqai/data_kitchen.py @@ -572,7 +572,8 @@ class FreqaiDataKitchen: else: # use SGDOneClassSVM to increase speed? - self.svm_model = linear_model.SGDOneClassSVM(nu=0.1).fit( + nu = self.freqai_config.get('feature_parameters', {}).get('svm_nu', 0.2) + self.svm_model = linear_model.SGDOneClassSVM(nu=nu).fit( self.data_dictionary["train_features"] ) y_pred = self.svm_model.predict(self.data_dictionary["train_features"]) @@ -742,7 +743,7 @@ class FreqaiDataKitchen: max_time = self.freqai_config.get('expiration_hours', 0) if max_time > 0: return elapsed_time > max_time - else: + else: return False def check_if_new_training_required(self, trained_timestamp: int) -> Tuple[bool, diff --git a/freqtrade/freqai/freqai_interface.py b/freqtrade/freqai/freqai_interface.py index 82a390a49..7062947a8 100644 --- a/freqtrade/freqai/freqai_interface.py +++ b/freqtrade/freqai/freqai_interface.py @@ -248,7 +248,7 @@ class IFreqaiModel(ABC): # append the historic data once per round if self.data_drawer.historic_data: dh.update_historic_data(strategy) - logger.info(f'Updating historic data on pair {metadata["pair"]}') + logger.debug(f'Updating historic data on pair {metadata["pair"]}') # if trainable, check if model needs training, if so compute new timerange, # then save model and metadata.