mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 02:12:01 +00:00
ruff reformatted
This commit is contained in:
parent
7a04f876c3
commit
d7b86ee436
|
@ -261,7 +261,8 @@ class IFreqaiModel(ABC):
|
||||||
def _train_model(self, dataframe_train, pair, dk, tr_backtest):
|
def _train_model(self, dataframe_train, pair, dk, tr_backtest):
|
||||||
try:
|
try:
|
||||||
self.tb_logger = get_tb_logger(
|
self.tb_logger = get_tb_logger(
|
||||||
self.dd.model_type, dk.data_path, self.activate_tensorboard)
|
self.dd.model_type, dk.data_path, self.activate_tensorboard
|
||||||
|
)
|
||||||
model = self.train(dataframe_train, pair, dk)
|
model = self.train(dataframe_train, pair, dk)
|
||||||
self.tb_logger.close()
|
self.tb_logger.close()
|
||||||
return model
|
return model
|
||||||
|
@ -269,7 +270,9 @@ class IFreqaiModel(ABC):
|
||||||
logger.warning(
|
logger.warning(
|
||||||
f"Training {pair} raised exception {msg.__class__.__name__}. "
|
f"Training {pair} raised exception {msg.__class__.__name__}. "
|
||||||
f"from {tr_backtest.start_fmt} to {tr_backtest.stop_fmt}."
|
f"from {tr_backtest.start_fmt} to {tr_backtest.stop_fmt}."
|
||||||
f"Message: {msg}, skipping.", exc_info=True)
|
f"Message: {msg}, skipping.",
|
||||||
|
exc_info=True,
|
||||||
|
)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def start_backtesting(
|
def start_backtesting(
|
||||||
|
@ -373,10 +376,10 @@ class IFreqaiModel(ABC):
|
||||||
if self.plot_features and self.model is not None:
|
if self.plot_features and self.model is not None:
|
||||||
plot_feature_importance(self.model, pair, dk, self.plot_features)
|
plot_feature_importance(self.model, pair, dk, self.plot_features)
|
||||||
if self.save_backtest_models and self.model is not None:
|
if self.save_backtest_models and self.model is not None:
|
||||||
logger.info('Saving backtest model to disk.')
|
logger.info("Saving backtest model to disk.")
|
||||||
self.dd.save_data(self.model, pair, dk)
|
self.dd.save_data(self.model, pair, dk)
|
||||||
else:
|
else:
|
||||||
logger.info('Saving metadata to disk.')
|
logger.info("Saving metadata to disk.")
|
||||||
self.dd.save_metadata(dk)
|
self.dd.save_metadata(dk)
|
||||||
else:
|
else:
|
||||||
self.model = self.dd.load_data(pair, dk)
|
self.model = self.dd.load_data(pair, dk)
|
||||||
|
@ -833,9 +836,11 @@ class IFreqaiModel(ABC):
|
||||||
:return: if the data exists or not
|
:return: if the data exists or not
|
||||||
"""
|
"""
|
||||||
if len_dataframe_backtest == 0:
|
if len_dataframe_backtest == 0:
|
||||||
logger.info(f"No data found for pair {pair} from "
|
logger.info(
|
||||||
|
f"No data found for pair {pair} from "
|
||||||
f"from {tr_backtest.start_fmt} to {tr_backtest.stop_fmt}. "
|
f"from {tr_backtest.start_fmt} to {tr_backtest.stop_fmt}. "
|
||||||
"Probably more than one training within the same candle period.")
|
"Probably more than one training within the same candle period."
|
||||||
|
)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user