From: Jérôme Benoit Date: Wed, 7 Jan 2026 00:14:46 +0000 (+0100) Subject: refactor(quickadapter): simplify early stopping condition checks X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ac21d67e08d81a858d6be647e9e665d2fdfd1797;p=freqai-strategies.git refactor(quickadapter): simplify early stopping condition checks 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. --- diff --git a/quickadapter/user_data/strategies/Utils.py b/quickadapter/user_data/strategies/Utils.py index 404fafa..fec90b9 100644 --- a/quickadapter/user_data/strategies/Utils.py +++ b/quickadapter/user_data/strategies/Utils.py @@ -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,