metricengine.reductions
- metricengine.reductions.fv_weighted_mean(items, *, mode=None, policy=None)[source]
Weighted mean of values (v_i) with weights (w_i): sum(v_i * w_i) / sum(w_i).
- Return type:
FV
- ZERO mode semantics:
Treat value None as 0 (weight still counts).
Treat weight None as 0 (pair contributes nothing).
- SKIP mode semantics:
Skip pairs where value or weight is None.
- PROPAGATE mode semantics:
Any None → propagate None (handled early).
- RAISE mode semantics:
Any None → raise (handled early).