]> Piment Noir Git Repositories - freqai-strategies.git/commit
refactor(quickadapter): deduplicate combined label-weight aggregate (#170) (#195)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 31 Jul 2026 13:06:10 +0000 (15:06 +0200)
committerGitHub <noreply@github.com>
Fri, 31 Jul 2026 13:06:10 +0000 (15:06 +0200)
commit479078eaeba7090f545e1272bc12e865e279d794
tree6bcbbbfb7d185aca731f919ef68d12d940b2e071
parent1b488f4c943aeb7a67196dc574e2dde6c4c48193
refactor(quickadapter): deduplicate combined label-weight aggregate (#170) (#195)

Share the combined `select -> impute -> aggregate` pipeline between the value
path (`_compute_combined_label_weights`) and the dependency-mask path
(`compute_label_weight_imputation_dependency_mask`) via a single
`_compute_combined_label_weight_pipeline` helper returning a
`_CombinedWeightPipeline`. The mask branch now derives the per-component and
aggregate non-finite masks and the leading-stable release (#169) from the
shared result instead of re-running selection, imputation, and aggregation.

Behavior is bit-for-bit identical for `compute_label_weights` and
`compute_label_weight_imputation_dependency_mask` across all strategies,
aggregations, fill methods, and causal/non-causal modes, including raised
exception type, message, and order. The two imputers (`_impute_weights` and
`_causal_impute_weights`) stay distinct; the epsilon path keeps its causal
imputer through the shared helper.
quickadapter/user_data/strategies/Utils.py