Support allocation scoring via forecast_allocation class
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia leggendo la discussione sullo scoring delle allocazioni in #1069 e la relativa implementazione del variogramma in #1111, quindi confronta il costruttore e le metriche proposti con le convenzioni di scoringutils. Risolvi le questioni di progettazione aperte prima di implementare as_forecast_allocation(), gpl_loss() e gpl_regret(); il lavoro è completo quando le allocazioni precalcolate possono essere valutate e riepilogate tramite il workflow indicato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Add a forecast_allocation class to support scoring of resource allocation forecasts using generalised piecewise linear (GPL) loss functions, complementing the allocation scoring framework in the alloscore package (Gerding et al.).
Motivation
Allocation scoring (Gerding et al., 2023) evaluates forecasts through the lens of constrained resource allocation.
The central question is whether a forecast leads to good resource allocation decisions when a decision-maker must distribute a limited budget K across targets (e.g. locations).
This is directly relevant to public health forecasting (distributing vaccines, antivirals, hospital beds across regions) and was discussed in #1069 alongside the variogram score.
The alloscore package implements both the optimisation step (finding optimal allocations from forecast distributions) and the scoring step (evaluating allocations against outcomes).
This proposal covers only the scoring step in scoringutils, with alloscore handling the optimisation.
Reference: Gerding, A., Reich, N.G., Rogers, B. and Ray, E.L. (2023). Evaluating infectious disease forecasts with allocation scoring rules. arXiv:2312.16201
Proposed design
New class: forecast_allocation
An allocation forecast stores, per target within an allocation group:
- The allocation amount (predicted)
- The observed demand (observed)
- GPL loss parameters for scoring
| Column | Type | Description |
|---|---|---|
observed |
numeric | Observed demand at this target |
predicted |
numeric | Allocated amount at this target |
.alloc_group_id |
any | Groups targets sharing a budget constraint |
K |
numeric | Total resource budget for this group |
kappa |
numeric | GPL scale parameter (default: 1) |
alpha |
numeric | GPL asymmetry parameter (default: 0.5) |
w |
numeric | Per-unit cost weight (default: 1) |
The .alloc_group_id column plays the same structural role as .mv_group_id in forecast_multivariate_sample.
Constructor
as_forecast_allocation(
data,
forecast_unit = NULL,
alloc_across = NULL, # columns defining what is allocated across
K = NULL, # column name (required)
kappa = NULL, # column name or default value
alpha = NULL # column name or default value
)
Scoring metrics
gpl_loss(): realised GPL loss summed within each allocation groupgpl_regret(): excess loss relative to oracle allocation with perfect foresight
User workflow
# User computes allocations via alloscore or their own method
# Then evaluates them in scoringutils:
forecast <- as_forecast_allocation(
allocation_data,
alloc_across = "location",
K = "K", alpha = "alpha"
)
scores <- score(forecast)
scores |> summarise_scores(by = "model")
Relationship to alloscore
This design complements alloscore rather than replacing it:
| Concern | alloscore | scoringutils |
|---|---|---|
| Compute optimal allocations from forecast distributions | Yes | No |
| Score pre-computed allocations against outcomes | Yes | Yes |
| Evaluation pipeline (summarise, compare, visualise) | Limited | Yes |
Generality
The design works for any constrained vector prediction problem with asymmetric loss, not just epidemic resource allocation.
Open questions
- Should
as_forecast_allocation()strictly requiresum(w * predicted) == Kor allow under-utilisation? - How to handle the
g(increment) function in GPL loss: support identity and log as built-in string options? - Should oracle computation live in scoringutils, or should users provide oracle scores from alloscore?
- Should GPL parameters be data columns, metric arguments via
purrr::partial(), or both?
Related issues
- #1069 (original variogram/allocation score discussion)
- #1111 (variogram score implementation)
This was opened by a bot. Please ping @seabbs for any questions.
- Lingua principale
- R
- Stelle
- 65
- Fork
- 24
- Merge medio
- 1h 24m
- PR unite (30g)
- 2
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di epiforecasts/scoringutils
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
epiforecasts/scoringutils#1264 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
epiforecasts/scoringutils#1265 ·
I maintainer di solito rispondono entro 1 giorno
-
Non-randomised PIT for integer forecasts drops forecasts whose observation exceeds all samplesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
epiforecasts/scoringutils#1260 ·
I maintainer di solito rispondono entro 1 giorno
-
Incorrect guidance in `NEWS.md` re `add_relative_skill()`?Forse già presa @nikosbosse l’ha presa 3 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
epiforecasts/scoringutils#1226 · 1 commento · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
get_pit_histogram(): unsorted breaks produce negative densities; num_bins = 1 returns an empty tableForse già presa @nikosbosse l’ha presa 3 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
epiforecasts/scoringutils#1219 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di epiforecasts/scoringutils
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
waldronlab/bugphyzz#301 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
r-lib/tree-sitter-r#209 ·
-
Suggest rmoriebricklayerAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 67/100
-
Suggest rmoriebricklayerAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 79/100
cran-task-views/CausalInference#52 · 1 commento ·