]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
refactor(qav3): variable namespace cleanup
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 19 Feb 2025 23:21:24 +0000 (00:21 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 19 Feb 2025 23:21:24 +0000 (00:21 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
quickadapter/user_data/freqaimodels/LightGBMRegressorQuickAdapterV35.py
quickadapter/user_data/freqaimodels/XGBoostRegressorQuickAdapterV35.py

index 435658b79dc732b54a57a78c24952435b181cf04..c2889aa4221c62934d0cc9a9b422fb25f8c45945 100644 (file)
@@ -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)
 
index 9c6cf1b37c3984bf70d7355d0f4c3ed78dcce28a..86bba7811193fb0c645402681434beb775861126 100644 (file)
@@ -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)