expose nu in the SVM outlier detection via svm_nu in config
This commit is contained in:
parent
7dfbd432d1
commit
6c7d02cb18
@ -572,7 +572,8 @@ class FreqaiDataKitchen:
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
# use SGDOneClassSVM to increase speed?
|
# 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"]
|
self.data_dictionary["train_features"]
|
||||||
)
|
)
|
||||||
y_pred = self.svm_model.predict(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)
|
max_time = self.freqai_config.get('expiration_hours', 0)
|
||||||
if max_time > 0:
|
if max_time > 0:
|
||||||
return elapsed_time > max_time
|
return elapsed_time > max_time
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def check_if_new_training_required(self, trained_timestamp: int) -> Tuple[bool,
|
def check_if_new_training_required(self, trained_timestamp: int) -> Tuple[bool,
|
||||||
|
@ -248,7 +248,7 @@ class IFreqaiModel(ABC):
|
|||||||
# append the historic data once per round
|
# append the historic data once per round
|
||||||
if self.data_drawer.historic_data:
|
if self.data_drawer.historic_data:
|
||||||
dh.update_historic_data(strategy)
|
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,
|
# if trainable, check if model needs training, if so compute new timerange,
|
||||||
# then save model and metadata.
|
# then save model and metadata.
|
||||||
|
Loading…
Reference in New Issue
Block a user