From: Jérôme Benoit Date: Wed, 26 Feb 2025 19:57:40 +0000 (+0100) Subject: refactor(qav3)!: sensible name for prediction thresholds smoothing X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=3ed4d987f7b13f3a27c6c71f59a11287777b060f;p=freqai-strategies.git refactor(qav3)!: sensible name for prediction thresholds smoothing Signed-off-by: Jérôme Benoit --- diff --git a/quickadapter/user_data/config-template.json b/quickadapter/user_data/config-template.json index e9a5931..ec72793 100644 --- a/quickadapter/user_data/config-template.json +++ b/quickadapter/user_data/config-template.json @@ -114,7 +114,7 @@ "fit_live_predictions_candles": 300, "data_kitchen_thread_count": 6, // set to number of CPU threads / 4 "track_performance": false, - "predictions_smoothing": "mean", + "prediction_thresholds_smoothing": "mean", "outlier_threshold": 0.999, "optuna_hyperopt": { "enabled": true, diff --git a/quickadapter/user_data/freqaimodels/LightGBMRegressorQuickAdapterV35.py b/quickadapter/user_data/freqaimodels/LightGBMRegressorQuickAdapterV35.py index 625ddc3..91015a4 100644 --- a/quickadapter/user_data/freqaimodels/LightGBMRegressorQuickAdapterV35.py +++ b/quickadapter/user_data/freqaimodels/LightGBMRegressorQuickAdapterV35.py @@ -269,22 +269,24 @@ class LightGBMRegressorQuickAdapterV35(BaseRegressionModel): fit_live_predictions_candles: int, label_period_candles: int, ) -> tuple[float, float]: - predictions_smoothing = self.freqai_info.get("predictions_smoothing", "mean") - if predictions_smoothing == "quantile": + prediction_thresholds_smoothing = self.freqai_info.get( + "prediction_thresholds_smoothing", "mean" + ) + if prediction_thresholds_smoothing == "quantile": return self.quantile_min_max_pred( pred_df, fit_live_predictions_candles, label_period_candles ) - elif predictions_smoothing == "mean": + elif prediction_thresholds_smoothing == "mean": return mean_min_max_pred( pred_df, fit_live_predictions_candles, label_period_candles ) - elif predictions_smoothing == "median": + elif prediction_thresholds_smoothing == "median": return median_min_max_pred( pred_df, fit_live_predictions_candles, label_period_candles ) else: raise ValueError( - f"Invalid predictions_smoothing value: '{predictions_smoothing}'" + f"Invalid prediction_thresholds_smoothing value: '{prediction_thresholds_smoothing}'" ) def optuna_hp_enqueue_previous_best_trial( diff --git a/quickadapter/user_data/freqaimodels/XGBoostRegressorQuickAdapterV35.py b/quickadapter/user_data/freqaimodels/XGBoostRegressorQuickAdapterV35.py index 58dd417..5e798fd 100644 --- a/quickadapter/user_data/freqaimodels/XGBoostRegressorQuickAdapterV35.py +++ b/quickadapter/user_data/freqaimodels/XGBoostRegressorQuickAdapterV35.py @@ -270,22 +270,24 @@ class XGBoostRegressorQuickAdapterV35(BaseRegressionModel): fit_live_predictions_candles: int, label_period_candles: int, ) -> tuple[float, float]: - predictions_smoothing = self.freqai_info.get("predictions_smoothing", "mean") - if predictions_smoothing == "quantile": + prediction_thresholds_smoothing = self.freqai_info.get( + "prediction_thresholds_smoothing", "mean" + ) + if prediction_thresholds_smoothing == "quantile": return self.quantile_min_max_pred( pred_df, fit_live_predictions_candles, label_period_candles ) - elif predictions_smoothing == "mean": + elif prediction_thresholds_smoothing == "mean": return mean_min_max_pred( pred_df, fit_live_predictions_candles, label_period_candles ) - elif predictions_smoothing == "median": + elif prediction_thresholds_smoothing == "median": return median_min_max_pred( pred_df, fit_live_predictions_candles, label_period_candles ) else: raise ValueError( - f"Invalid predictions_smoothing value: '{predictions_smoothing}'" + f"Invalid prediction_thresholds_smoothing value: '{prediction_thresholds_smoothing}'" ) def optuna_hp_enqueue_previous_best_trial(