Update SpreadSkillRatio docstrings and tests#338
Merged
sgreenbury merged 1 commit intomainfrom Apr 21, 2026
Merged
Conversation
Updated the metric docstrings to explicitly describe the "mean of per-sample ratios" aggregation convention. This prevents future confusion about macroscopic computation differences and explicitly links to the expected Lola behaviour. Updated the `__init__` method to forward `**kwargs` to the base class so that `reduce_all` can be passed correctly during metric instantiation, standardizing the interface with other metrics. Added three comprehensive tests: - SSR monotonically decreases when skill grows and spread is fixed - Calibrated ensemble has SSR near 1.0 (finite-ensemble correction) - Stateful update() matches a mean-of-ratios (not macroscopic ratio)
879768d to
dd6f1e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SpreadSkillRatio(monotonic decrease when skill grows; near-1 for calibrated ensembles; stateful aggregation is mean-of-ratios).SpreadSkillRatio.__init__with other metrics by forwarding**kwargssoreduce_allcan be configured at construction.Why
SSR behaviour/aggregation can be misinterpreted when debugging calibration vs coverage; the tests lock in the intended semantics and catch future accidental changes.
Note on production output
Existing SSR values in rollout/eval CSVs are unchanged by this PR. The
**kwargsaddition is a cleanliness change:src/autocast/scripts/eval/encoder_processor_decoder.py::_build_per_timestep_metric_factoryalready handled the missing kwarg via aTypeErrorfallback that instantiated the metric and setmetric.reduce_all = Falseafterwards, which is behaviorally equivalent.Test plan
uv run pytest tests/metrics/test_ensemble.py -k spread_skill_ratio