src.dackar.similarity.scoreAggregator¶
Weighted combination of per-dimension similarity scores.
A small, domain-agnostic helper: given a {dimension: weight} mapping, it
combines a {dimension: score} mapping into a single scalar, clamped to
[0, 1]. Dimensions are arbitrary string labels, so the same aggregator
serves any multi-dimensional scoring scheme.
Only the standard library is required.
Classes¶
Combine per-dimension scores into one total via a weights mapping. |
Module Contents¶
- class src.dackar.similarity.scoreAggregator.WeightedScoreAggregator(weights)[source]¶
Combine per-dimension scores into one total via a weights mapping.
- Parameters:
weights (Mapping[str, float]) –
{dimension: weight}. Any dimension absent from a givenscoresmapping contributes 0; any score whose dimension is absent fromweightsis ignored.
The output of
combine()is clamped to[0, 1]regardless of the weight configuration. Without clamping, un-normalized weights (summing to more than 1) would yield totals above 1.0.