From: Jérôme Benoit Date: Wed, 19 Feb 2025 23:21:24 +0000 (+0100) Subject: refactor(qav3): variable namespace cleanup X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f3d9b8dd256f27c1e7ae2092beade28fffe66757;p=freqai-strategies.git refactor(qav3): variable namespace cleanup Signed-off-by: Jérôme Benoit --- 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)