Skip to main content

Module reducer

Module reducer 

Source
Expand description

Offline log-odds reducer for evidence events.

Replaces the online order-dependent accumulator with a pure function over the full event set: group by (family, polarity), sort each group by weight descending, apply a polarity-specific diminishing-returns schedule, cap the contribution per group, and sum the discounted signed log-odds. Order-invariant by construction.

Structs§

EvidenceEvent
A single evidence event collected for offline aggregation.
ReductionResult
Result of reducing a full event set, with per-event log-odds attribution.

Enums§

EvidencePolarity
Polarity of an evidence event.

Constants§

CONTRADICTORY_SCHEDULE
Diminishing-returns schedule for Contradictory evidence (softer than positive).
PER_GROUP_CAP
Per-(family, polarity) cap on contribution magnitude.
POSITIVE_SCHEDULE
Diminishing-returns schedule for Positive evidence.

Functions§

reduce_all
Total log-odds across all (family, polarity) groups.
reduce_family_polarity
Reduces a single (family, polarity) group of events to a discounted log-odds contribution.
reduce_with_attribution
Reduces all events and reports per-event log-odds attribution under the same sort, schedule, and cap rules as reduce_all. contributions[i] corresponds to events[i]. When a group exceeds PER_GROUP_CAP, every event in that group is scaled by cap / |unclamped_sum| so the group’s contributions sum exactly to the signed cap.