From: Jérôme Benoit Date: Sun, 24 May 2026 00:00:58 +0000 (+0200) Subject: feat(weights): add _strip_label_weight_columns helper for find_labels collision avoidance X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=9591f747f9468c8a9738c29d24e3663b4ad302c8;p=freqai-strategies.git feat(weights): add _strip_label_weight_columns helper for find_labels collision avoidance --- diff --git a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py index f644f3f..661bce1 100644 --- a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py +++ b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py @@ -102,6 +102,18 @@ class QuickAdapterRegressorV3(BaseRegressionModel): _TEST_SIZE: Final[float] = 0.1 + _LABEL_WEIGHT_SUFFIX: Final[str] = "_weight" + + @staticmethod + def _label_weight_column_name(label_col: str) -> str: + return f"{label_col}{QuickAdapterRegressorV3._LABEL_WEIGHT_SUFFIX}" + + def _strip_label_weight_columns(self, dk: FreqaiDataKitchen) -> None: + dk.label_list = [ + c for c in dk.label_list + if not c.endswith(self._LABEL_WEIGHT_SUFFIX) + ] + _SQRT_2: Final[float] = np.sqrt(2.0) _OPTUNA_LABEL_N_OBJECTIVES: Final[int] = 7