Aggregate
Reduce a set to a summary statistic
Mechanism
A deterministic function that maps a Vector of inputs to a single Scalar Value. Implements standard statistical operations (Mean, Mode, Median) to compress signal bandwidth. When the caller supplies Vector alongside the vector, the reduction becomes a weighted one. It serves as the computational backbone for consensus mechanisms.
Invariants
- Determinism: F(Input) always yields the same Output.
- Yields one scalar Value whatever the input length, including length one.
Parameters
- function: type=Enum, range={Mean, Median, Mode, Sum, Min, Max, Variance, StdDev}, description=Default: Mean
Preconditions
- All elements in list share a comparable type
- Input list is non-empty
Postconditions
- Single summary value returned
Failure modes
- Type Mismatch: Input list contains incomparable types (e.g., Integers mixed with Strings).
- Empty Set: Attempting to aggregate a list with length 0 (Undefined for Mean/Mode).
- Overflow: Sum of inputs exceeds maximum integer size (if strictly typed).
Where this came from
—
Builds on
Used by
- ChunkMerge references
- DriftWatch references
- Parallelize composes_with
- PerspectiveEnsemble references
- SelfConsistency references
- Vote references
Identity
- Ref:
Aggregate#bb80 - Hash: sema:Aggregate#mh:SHA-256:bb809289d74615fd774f32704d3857a5e4d45480ad5b68de8f995e0c9e445d21
- Library: bootstrap 0.11.0, root a6a3d1ff0f98
- License: Not stated; check the repository