Pairwise comparisons: crashes and degenerate results in edge cases

Aperta
#1,267 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
r
Ambito
data

Direzione di ricerca

Start with R/pairwise-comparisons.R and inspect get_pairwise_comparisons(), add_relative_skill(), and plot_pairwise_comparisons() against each listed edge case. Read the related issues #1209 and #769 for the expected handling of groups with too few comparators. Done when the listed crashes, invalid ratios, row reordering, default metric failure, and plotting behavior are addressed with suitable checks or tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

CLAUDE: Edge cases in get_pairwise_comparisons(), add_relative_skill() and plot_pairwise_comparisons() (R/pairwise-comparisons.R), not covered by #1209 / #769:

  • A numeric compare column always crashes: "Incompatible join types: x.model (character) and i.model (double)". Hits integer model ids or compare = "horizon".
    d <- data.table(model = rep(c(1, 2), each = 3), target = rep(1:3, 2), wis = c(1, 1, 1, 2, 2, 2))
    get_pairwise_comparisons(scoringutils:::new_scores(d, metrics = "wis"))
    
  • A baseline missing from one by group aborts the whole call ("Baseline comparator B missing."). Should be handled like groups with too few comparators (#1209).
  • Zero scores give relative skill 0, Inf or NaN without a warning, e.g. WIS of 0 for perfect forecasts of zero counts in a small group.
  • baseline of length > 1 is accepted and recycled with a base R warning. Use assert_string().
  • NA in the compare column, or a comparator named like a forecast-unit column (e.g. a model called "target"), silently gets NA ratios and a relative skill of 1.
  • add_relative_skill() reorders the rows, returns a keyed table, and a second call produces .x / .y columns.
  • No default metric for nominal, ordinal and multivariate scores: add_relative_skill(score(...)) fails with an assertion on metric because the default only considers wis, crps and brier_score.
  • plot_pairwise_comparisons() hard-codes model: with compare = "location", by = "model" the y axis shows models, not locations; without a model column it errors.

Found during a full review of the package (version 2.3.0.9000, main at 779d7d68).

Lingua principale
R
Stelle
65
Fork
24
Merge medio
1h 24m
PR unite (30g)
2

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di epiforecasts/scoringutils

Tutte le issue di epiforecasts/scoringutils

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.