]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
refactor(quickadapter): ensure 1D target with HistGradientBoostingRegressor
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 28 Dec 2025 01:34:12 +0000 (02:34 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 28 Dec 2025 01:34:12 +0000 (02:34 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
quickadapter/user_data/strategies/Utils.py

index 8a53372b90f73832f516ab3c198f3cc94bf5e860..4364ee3f0656a9334a137a8ce146b5262ee30a46 100644 (file)
@@ -2058,6 +2058,7 @@ def fit_regressor(
         y_val = None
         if eval_set is not None and len(eval_set) > 0:
             X_val, y_val = eval_set[0]
+            y_val = y_val.to_numpy().ravel()
 
         sample_weight_val = None
         if eval_weights is not None and len(eval_weights) > 0:
@@ -2071,7 +2072,7 @@ def fit_regressor(
 
         model.fit(
             X=X,
-            y=y,
+            y=y.to_numpy().ravel(),
             sample_weight=train_weights,
             X_val=X_val,
             y_val=y_val,