]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
fix(quickadapter): restrict CatBoost grow_policy for Ordered boosting
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 8 Jan 2026 21:10:38 +0000 (22:10 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 8 Jan 2026 21:10:38 +0000 (22:10 +0100)
CatBoost's Ordered boosting mode only supports SymmetricTree grow policy.
When Optuna suggested Ordered boosting with Depthwise or Lossguide grow
policies, CatBoost raised: "Ordered boosting is not supported for
nonsymmetric trees."

This fix conditionally restricts grow_policy options to SymmetricTree when
boosting_type is Ordered, preventing invalid parameter combinations during
hyperparameter optimization.

Reference: catboost/catboost source (catboost_options.cpp:~758)

quickadapter/user_data/strategies/Utils.py

index cc3be9b2324b9945cf7846a529952c5a1fe0f4ad..8cde3cc0eeb3d3004ae6b9d5f48b38dfde260b75 100644 (file)
@@ -2489,6 +2489,10 @@ def get_optuna_study_model_parameters(
             "boosting_type", boosting_type_options
         )
         bootstrap_type = trial.suggest_categorical("bootstrap_type", bootstrap_options)
+        if boosting_type == "Ordered":
+            grow_policy_options = ["SymmetricTree"]
+        else:
+            grow_policy_options = ["SymmetricTree", "Depthwise", "Lossguide"]
 
         params: dict[str, Any] = {
             # Boosting/Training
@@ -2510,7 +2514,7 @@ def get_optuna_study_model_parameters(
                 trial, "min_data_in_leaf", ranges["min_data_in_leaf"], min_val=1
             ),
             "grow_policy": trial.suggest_categorical(
-                "grow_policy", ["SymmetricTree", "Depthwise", "Lossguide"]
+                "grow_policy", grow_policy_options
             ),
             # Regularization
             "l2_leaf_reg": trial.suggest_float(