Expand description
ADR-07 canonical prediction-aggregation reducer contract.
dag-ml-data owns the reducer names, parameters and validation so the
conformance pack is complete and every binding agrees on the surface. The
numerical execution (mean/median/robust-mean, the Hotelling T² outlier
boundary, vote tallies) belongs to the host bridge — there is no reducer
math in this layer. skipna = true is fixed ADR-07 contract behaviour and is
not configurable in v1.
The policy is a flat struct with deny_unknown_fields (not an internally
tagged enum) so the JSON wire shape stays flat — {"reducer": "robust_mean", "trim_fraction": 0.1} — yet unknown keys such as skipna are rejected at the
boundary, keeping the Rust deserializer and the C ABI validator
(dagmldata_aggregation_policy_validate_json) in agreement. Type-level
looseness (a parameter that belongs to another reducer) is caught
semantically by AggregationPolicy::validate. No shared JSON schema is
published yet — the conformance pack pins only the validator symbol (the
dag-ml coordinator-level aggregation policy stays a distinct contract; see the
ADR-07 reconciliation follow-up).
Structs§
- Aggregation
Policy - Aggregation policy: which reducer collapses repeated predictions to one value
per sample, plus the single parameter that reducer accepts. Parameters that
do not belong to the chosen reducer must be absent (enforced by
validate).Nonenumeric parameters take the ADR-07 defaults (DEFAULT_TRIM_FRACTION,DEFAULT_THRESHOLD).
Enums§
- Aggregation
Reducer Name - Canonical per-sample aggregation reducer name (ADR-07).
- Prediction
Task Kind - Prediction task kind needed to validate task-sensitive reducers. This is a
deliberately tiny enum; the bridge maps its richer task type into it. It does
not make
dag-ml-datathe home of DAG-ML task semantics.
Constants§
- CANONICAL_
AGGREGATION_ REDUCERS - The canonical reducer names. The
customescape hatch is intentionally not listed; it is addressed bycustom_reducer_idinstead. This array is the source of truth for the canonical set (the conformance pack pins only the C ABI validator symbol, not a shared reducer list). - DEFAULT_
THRESHOLD - Default
thresholdforexclude_outlierswhen unspecified (ADR-07). - DEFAULT_
TRIM_ FRACTION - Default
trim_fractionforrobust_meanwhen unspecified (ADR-07).