]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
refactor(quickadapter): simplify early stopping condition checks
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 7 Jan 2026 00:14:46 +0000 (01:14 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 7 Jan 2026 00:14:46 +0000 (01:14 +0100)
Remove redundant has_eval_set verification in early stopping callbacks for XGBoost and LightGBM. The check is unnecessary because early_stopping_rounds is only assigned a non-None value when has_eval_set is True, making the condition implicitly guaranteed.

quickadapter/user_data/strategies/Utils.py

index 404fafa5911e239ea77e0b0112129daa6ba23ade..fec90b981001bba5e04e9d05b37cd088bb2bbfca 100644 (file)
@@ -1674,7 +1674,7 @@ def fit_regressor(
         else:
             model_training_parameters.pop("early_stopping_rounds", None)
 
-        if early_stopping_rounds is not None and has_eval_set:
+        if early_stopping_rounds is not None:
             fit_callbacks.append(
                 EarlyStopping(
                     rounds=early_stopping_rounds,