expose nu in the SVM outlier detection via svm_nu in config

This commit is contained in:
robcaulk 2022-06-28 15:12:25 +02:00
parent 7dfbd432d1
commit 6c7d02cb18
2 changed files with 4 additions and 3 deletions

View File

@ -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,

View File

@ -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.