]> Piment Noir Git Repositories - freqai-strategies.git/commitdiff
fix(weights): persist label weights into <label>_weight column instead of rescaling...
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 23 May 2026 23:55:34 +0000 (01:55 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 23 May 2026 23:55:34 +0000 (01:55 +0200)
Removes statistically incorrect target rescaling (label = direction × weight). Persists raw direction labels and a separate <label>_weight column for downstream sample_weight composition. Validated locally with pytest (evidence: .omo/evidence/task-6-{red,green}.txt).

quickadapter/user_data/strategies/QuickAdapterV3.py

index 7fc6a40f7364b4b54c33c53018af60b034d2d468..37b262ee2a487b638e3ee9fe31a1f974efc5b9bc 100644 (file)
@@ -826,14 +826,15 @@ class QuickAdapterV3(IStrategy):
                 label_col, label_weighting["default"], label_weighting["columns"]
             )
 
-            weighted_label, _ = apply_label_weighting(
+            _, label_weights = apply_label_weighting(
                 label=label_data.series,
                 indices=label_data.indices,
                 metrics=label_data.metrics,
                 weighting_config=col_weighting_config,
             )
 
-            dataframe[label_col] = weighted_label
+            dataframe[label_col] = label_data.series
+            dataframe[f"{label_col}_weight"] = label_weights
 
             if label_col == EXTREMA_COLUMN:
                 extrema = dataframe[label_col]