From f3d9b8dd256f27c1e7ae2092beade28fffe66757 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 20 Feb 2025 00:21:24 +0100 Subject: [PATCH] refactor(qav3): variable namespace cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../freqaimodels/LightGBMRegressorQuickAdapterV35.py | 6 +++--- .../freqaimodels/XGBoostRegressorQuickAdapterV35.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/quickadapter/user_data/freqaimodels/LightGBMRegressorQuickAdapterV35.py b/quickadapter/user_data/freqaimodels/LightGBMRegressorQuickAdapterV35.py index 435658b..c2889aa 100644 --- a/quickadapter/user_data/freqaimodels/LightGBMRegressorQuickAdapterV35.py +++ b/quickadapter/user_data/freqaimodels/LightGBMRegressorQuickAdapterV35.py @@ -592,9 +592,9 @@ def period_objective( y_test = y_test[:min_length] y_pred = y_pred[:min_length] # trim last chunk if needed - min_last_chunk_length = min(len(y_test[-1]), len(y_pred[-1])) - y_test[-1] = y_test[-1][:min_last_chunk_length] - y_pred[-1] = y_pred[-1][:min_last_chunk_length] + last_chunk_min_length = min(len(y_test[-1]), len(y_pred[-1])) + y_test[-1] = y_test[-1][:last_chunk_min_length] + y_pred[-1] = y_pred[-1][:last_chunk_min_length] error = sklearn.metrics.root_mean_squared_error(y_test, y_pred) diff --git a/quickadapter/user_data/freqaimodels/XGBoostRegressorQuickAdapterV35.py b/quickadapter/user_data/freqaimodels/XGBoostRegressorQuickAdapterV35.py index 9c6cf1b..86bba78 100644 --- a/quickadapter/user_data/freqaimodels/XGBoostRegressorQuickAdapterV35.py +++ b/quickadapter/user_data/freqaimodels/XGBoostRegressorQuickAdapterV35.py @@ -596,9 +596,9 @@ def period_objective( y_test = y_test[:min_length] y_pred = y_pred[:min_length] # trim last chunk if needed - min_last_chunk_length = min(len(y_test[-1]), len(y_pred[-1])) - y_test[-1] = y_test[-1][:min_last_chunk_length] - y_pred[-1] = y_pred[-1][:min_last_chunk_length] + last_chunk_min_length = min(len(y_test[-1]), len(y_pred[-1])) + y_test[-1] = y_test[-1][:last_chunk_min_length] + y_pred[-1] = y_pred[-1][:last_chunk_min_length] error = sklearn.metrics.root_mean_squared_error(y_test, y_pred) -- 2.43.0