]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
refactor(qav3)!: sensible name for prediction thresholds smoothing
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 26 Feb 2025 19:57:40 +0000 (20:57 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 26 Feb 2025 19:57:40 +0000 (20:57 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
quickadapter/user_data/config-template.json
quickadapter/user_data/freqaimodels/LightGBMRegressorQuickAdapterV35.py
quickadapter/user_data/freqaimodels/XGBoostRegressorQuickAdapterV35.py

index e9a59311b1f6b9ec4d8a9aeb1f6fd7a4e79f4e5b..ec7279320a518010895fe4af50d991b6c9d24de8 100644 (file)
     "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,
index 625ddc3df0a1d60e55298e0e1f1a986c7c4d9ee5..91015a464fa1227ac6e9d01d5c602a196a8e166d 100644 (file)
@@ -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(
index 58dd4175a3474944bbcbeebdac82f4af63a3b0f9..5e798fdeb55af004f3c0a0fad7a1f15d7a1d6c45 100644 (file)
@@ -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(