From 52d3ee4689e0db2ce5ebeb0bcc3aaba3bf8443b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 14 Feb 2025 22:30:31 +0100 Subject: [PATCH] refactor(qav3): log more information at optuna failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../LightGBMRegressorQuickAdapterV35.py | 4 +-- .../XGBoostRegressorQuickAdapterV35.py | 4 +-- .../user_data/strategies/QuickAdapterV3.py | 30 ++++++++++--------- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/quickadapter/user_data/freqaimodels/LightGBMRegressorQuickAdapterV35.py b/quickadapter/user_data/freqaimodels/LightGBMRegressorQuickAdapterV35.py index c14e396..b4685ba 100644 --- a/quickadapter/user_data/freqaimodels/LightGBMRegressorQuickAdapterV35.py +++ b/quickadapter/user_data/freqaimodels/LightGBMRegressorQuickAdapterV35.py @@ -286,9 +286,7 @@ class LightGBMRegressorQuickAdapterV35(BaseRegressionModel): gc_after_trial=True, ) except Exception as e: - logger.error( - f"Optuna hyperopt failed: {e}. Consider using a concurrency friendly storage backend like 'file' or lower the number of jobs." - ) + logger.error(f"Optuna hyperopt failed: {e}", exc_info=True) hyperopt_failed = True if not hyperopt_failed: diff --git a/quickadapter/user_data/freqaimodels/XGBoostRegressorQuickAdapterV35.py b/quickadapter/user_data/freqaimodels/XGBoostRegressorQuickAdapterV35.py index 3c6cb57..ae8e0b0 100644 --- a/quickadapter/user_data/freqaimodels/XGBoostRegressorQuickAdapterV35.py +++ b/quickadapter/user_data/freqaimodels/XGBoostRegressorQuickAdapterV35.py @@ -289,9 +289,7 @@ class XGBoostRegressorQuickAdapterV35(BaseRegressionModel): gc_after_trial=True, ) except Exception as e: - logger.error( - f"Optuna hyperopt failed: {e}. Consider using a concurrency friendly storage backend like 'file' or lower the number of jobs." - ) + logger.error(f"Optuna hyperopt failed: {e}", exc_info=True) hyperopt_failed = True if not hyperopt_failed: diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index 651ab18..a5b4e8c 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -69,21 +69,23 @@ class QuickAdapterV3(IStrategy): can_short = False - plot_config = { - "main_plot": {}, - "subplots": { - "accuracy": {"rmse": {"color": "#c28ce3", "type": "line"}}, - "extrema": { - EXTREMA_COLUMN: {"color": "#f53580", "type": "line"}, - MINIMA_THRESHOLD_COLUMN: {"color": "#4ae747", "type": "line"}, - MAXIMA_THRESHOLD_COLUMN: {"color": "#e6be0b", "type": "line"}, - }, - "min_max": { - "maxima": {"color": "#0dd6de", "type": "bar"}, - "minima": {"color": "#e3970b", "type": "bar"}, + @property + def plot_config(self): + return { + "main_plot": {}, + "subplots": { + "accuracy": {"rmse": {"color": "#c28ce3", "type": "line"}}, + "extrema": { + EXTREMA_COLUMN: {"color": "#f53580", "type": "line"}, + MINIMA_THRESHOLD_COLUMN: {"color": "#4ae747", "type": "line"}, + MAXIMA_THRESHOLD_COLUMN: {"color": "#e6be0b", "type": "line"}, + }, + "min_max": { + "maxima": {"color": "#0dd6de", "type": "bar"}, + "minima": {"color": "#e3970b", "type": "bar"}, + }, }, - }, - } + } @property def protections(self): -- 2.43.0