From: Jérôme Benoit Date: Thu, 31 Jul 2025 16:37:31 +0000 (+0200) Subject: refactor(qav3): type cast some tunables X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=edda8420f9a8ae98b4beb36ae927f5a140049928;p=freqai-strategies.git refactor(qav3): type cast some tunables Signed-off-by: Jérôme Benoit --- diff --git a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py index 097f78b..a9986a8 100644 --- a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py +++ b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py @@ -288,7 +288,7 @@ class QuickAdapterRegressorV3(BaseRegressionModel): namespace="hp", objective=lambda trial: hp_objective( trial, - self.freqai_info.get("regressor", "xgboost"), + str(self.freqai_info.get("regressor", "xgboost")), X, y, train_weights, @@ -314,7 +314,7 @@ class QuickAdapterRegressorV3(BaseRegressionModel): namespace="train", objective=lambda trial: train_objective( trial, - self.freqai_info.get("regressor", "xgboost"), + str(self.freqai_info.get("regressor", "xgboost")), X, y, train_weights, @@ -348,7 +348,7 @@ class QuickAdapterRegressorV3(BaseRegressionModel): eval_set, eval_weights = self.eval_set_and_weights(X_test, y_test, test_weights) model = fit_regressor( - regressor=self.freqai_info.get("regressor", "xgboost"), + regressor=str(self.freqai_info.get("regressor", "xgboost")), X=X, y=y, train_weights=train_weights, diff --git a/quickadapter/user_data/strategies/QuickAdapterV3.py b/quickadapter/user_data/strategies/QuickAdapterV3.py index 1445896..60438c2 100644 --- a/quickadapter/user_data/strategies/QuickAdapterV3.py +++ b/quickadapter/user_data/strategies/QuickAdapterV3.py @@ -1000,9 +1000,9 @@ class QuickAdapterV3(IStrategy): series: Series, window: int, ) -> Series: - extrema_smoothing = self.freqai_info.get("extrema_smoothing", "gaussian") - extrema_smoothing_zero_phase = self.freqai_info.get( - "extrema_smoothing_zero_phase", True + extrema_smoothing = str(self.freqai_info.get("extrema_smoothing", "gaussian")) + extrema_smoothing_zero_phase = bool( + self.freqai_info.get("extrema_smoothing_zero_phase", True) ) std = derive_gaussian_std_from_window(window) extrema_smoothing_beta = float(