Skip to main content

Module aggregation

Module aggregation 

Source
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§

AggregationPolicy
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). None numeric parameters take the ADR-07 defaults (DEFAULT_TRIM_FRACTION, DEFAULT_THRESHOLD).

Enums§

AggregationReducerName
Canonical per-sample aggregation reducer name (ADR-07).
PredictionTaskKind
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-data the home of DAG-ML task semantics.

Constants§

CANONICAL_AGGREGATION_REDUCERS
The canonical reducer names. The custom escape hatch is intentionally not listed; it is addressed by custom_reducer_id instead. 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 threshold for exclude_outliers when unspecified (ADR-07).
DEFAULT_TRIM_FRACTION
Default trim_fraction for robust_mean when unspecified (ADR-07).