Expose forecast counts aligned to summarize_scores() grouping?
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with the summarize_scores() and get_forecast_unit() entry points, then compare the reference implementation in hubverse-org/hubEvals#145 and the use case in hubPredEvalsData#19. Clarify whether a summary-aligned count should be an opt-in API, how it interacts with metrics attributes and forecast-unit detection, and what tests would define the accepted behavior.
Written by the indexing model from the issue text.
Description
Context
In hubEvals we've added an opt-in argument to our score_model_out() wrapper that appends a count column to summarised scores: the number of forecasts scored in each summary group. It's useful context (it shows how much data each summarised mean rests on, and surfaces sparse or uneven coverage across models/groups), and hubPredEvalsData (which prepares the per-model data behind the hubverse evaluation dashboards) needs it to report the number of predictions scored per model (hubverse-org/hubPredEvalsData#19).
The gap
scoringutils already counts forecasts via get_forecast_counts(), which operates on the forecast object and returns a count column (de-duplicating over quantile_level / sample_id). But summarize_scores() exposes no count aligned to its by grouping. So to attach "number scored per summary group" we count the per-row scores before summarize_scores() collapses them, then join it back:
counts <- dplyr::count(scores, dplyr::across(dplyr::all_of(by)))
summ <- summarize_scores(scores, by = by)
summ <- dplyr::left_join(summ, counts, by = by) # + restore the `metrics` attribute
Question
Would you consider exposing a group count from summarize_scores() natively, e.g. an opt-in argument that also returns the group size alongside the summarised metrics? Or is there a recommended pattern we've missed? We appreciate that the design deliberately keeps counting on the forecast side (get_forecast_counts()), so we're really asking whether a summary-aligned count belongs in scoringutils or is better left to callers.
An extra reason it might belong upstream
Appending a count column onto a scores object downstream interacts awkwardly with get_forecast_unit(), which derives the forecast unit by elimination (any column that isn't protected or a listed metric is treated as a task-ID). A bolted-on count column is therefore misclassified as a forecast-unit column, which would skew the guards in get_pairwise_comparisons() / add_relative_skill() if such an object were routed back through them. If scoringutils owned the count column, it could protect the name in its class machinery and avoid this downstream footgun.
Reference implementation: hubverse-org/hubEvals#145.
- Dominant language
- R
- Stars
- 67
- Forks
- 24
- Avg merge
- 1h 24m
- Merged PRs (30d)
- 2
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from epiforecasts/scoringutils
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
epiforecasts/scoringutils#1264 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
epiforecasts/scoringutils#1265 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
epiforecasts/scoringutils#1260 ·
Maintainers usually reply within 1 day
-
Incorrect guidance in `NEWS.md` re `add_relative_skill()`?Possibly taken @nikosbosse claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
epiforecasts/scoringutils#1226 · 1 comment · 2 reactions ·
Maintainers usually reply within 1 day
-
get_pit_histogram(): unsorted breaks produce negative densities; num_bins = 1 returns an empty tablePossibly taken @nikosbosse claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
epiforecasts/scoringutils#1219 ·
Maintainers usually reply within 1 day
All issues in epiforecasts/scoringutils
Similar issues
-
data_bio2rarify - doc - dimensions wrongPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
leppott/BioMonTools#162 ·
-
publications
Difficulty 1/5 Under an hour Newbie friendliness 85/100
epiforecasts/epiforecasts.github.io#161 ·
Maintainers usually reply within 1 day
-
Label `{sas}` chunk source as `sas` instead of `txt`, so it gets syntax highlightingPossibly taken @michaelmayer2 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microbiome/OMA#1031 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ThinkR-open/golem#1265 ·