From 396cac04ff614bfcf68445e26576463f111dfa30 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 8 Jan 2026 22:10:38 +0100 Subject: [PATCH] fix(quickadapter): restrict CatBoost grow_policy for Ordered boosting 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/quickadapter/user_data/strategies/Utils.py b/quickadapter/user_data/strategies/Utils.py index cc3be9b..8cde3cc 100644 --- a/quickadapter/user_data/strategies/Utils.py +++ b/quickadapter/user_data/strategies/Utils.py @@ -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( -- 2.53.0