Retrain model if FreqAI found a pretrained model but user strategy is not passing the expected features (user has changed the features in the strategy but has passed a the same config[freqai][identifier]). Logger warning output to user.

This commit is contained in:
robcaulk 2022-05-19 17:15:50 +02:00
parent c708dd3186
commit 89eacf2f47

View File

@ -92,6 +92,11 @@ class IFreqaiModel(ABC):
self.dh.save_data(self.model)
else:
self.model = self.dh.load_data()
strategy_provided_features = self.dh.find_features(dataframe_train)
if strategy_provided_features != self.dh.training_features_list:
logger.info("User changed input features, retraining model.")
self.model = self.train(dataframe_train, metadata)
self.dh.save_data(self.model)
preds, do_preds = self.predict(dataframe_backtest, metadata)