From b8a1089592d2b6087fbd6dace25b2211d39cc93d Mon Sep 17 00:00:00 2001 From: robcaulk Date: Sun, 3 Mar 2024 12:23:18 +0100 Subject: [PATCH] fix: try plotting as much info in xgboost tensorboard as possible --- freqtrade/freqai/tensorboard/tensorboard.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/freqtrade/freqai/tensorboard/tensorboard.py b/freqtrade/freqai/tensorboard/tensorboard.py index 46bf8dc61..3ac58a117 100644 --- a/freqtrade/freqai/tensorboard/tensorboard.py +++ b/freqtrade/freqai/tensorboard/tensorboard.py @@ -46,10 +46,8 @@ class TensorBoardCallback(BaseTensorBoardCallback): for data, metric in evals_log.items(): for metric_name, log in metric.items(): score = log[-1][0] if isinstance(log[-1], tuple) else log[-1] - if data == "train": - self.writer.add_scalar("train_loss", score, epoch) - else: - self.writer.add_scalar("valid_loss", score, epoch) + key = self._get_key(data, metric_name) + self.writer.add_scalar(f"{key}_loss", score, epoch) return False