]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
feat(quickadapter): add tol parameter and tune HPO ranges for NGBoost
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 8 Jan 2026 16:11:29 +0000 (17:11 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 8 Jan 2026 16:11:29 +0000 (17:11 +0100)
quickadapter/user_data/strategies/Utils.py

index 0fe4cf372d80621bdc4d8e229fa68decd7d229ad..229e36515fa24df8898c023367c5aa3f18979397 100644 (file)
@@ -2366,22 +2366,25 @@ def get_optuna_study_model_parameters(
         }
 
     elif regressor == REGRESSORS[3]:  # "ngboost"
-        # Parameter order: boosting -> tree structure -> sampling -> distribution
+        # Parameter order: boosting -> tree structure -> sampling -> early stopping -> distribution
         default_ranges: dict[str, tuple[float, float]] = {
             # Boosting/Training
-            "n_estimators": (100, 1000),
+            "n_estimators": (200, 2000),
             "learning_rate": (0.001, 0.3),
             # Tree structure
-            "max_depth": (3, 8),
+            "max_depth": (2, 6),
             "min_samples_split": (2, 20),
             "min_samples_leaf": (1, 8),
             # Sampling
             "minibatch_frac": (0.6, 1.0),
             "col_sample": (0.4, 1.0),
+            # Early stopping
+            "tol": (1e-5, 1e-3),
         }
         log_scaled_params = {
             "n_estimators",
             "learning_rate",
+            "tol",
         }
 
         ranges = _build_ranges(default_ranges, log_scaled_params)
@@ -2418,6 +2421,13 @@ def get_optuna_study_model_parameters(
                 ranges["col_sample"][0],
                 ranges["col_sample"][1],
             ),
+            # Early stopping
+            "tol": trial.suggest_float(
+                "tol",
+                ranges["tol"][0],
+                ranges["tol"][1],
+                log=True,
+            ),
             # Distribution
             "dist": trial.suggest_categorical("dist", ["normal", "lognormal"]),
         }