scoringutils drops forecasts with NA in any column, including covariates
まだ誰も着手していません。
評価
調査の方向性
Start with R/process-score.R and trace how the trend column is passed to as_forecast_quantile(); then inspect process_data() for the planned explicit forecast_unit and covariate-window exclusion. Reproduce the dropped rows with the supplied scoringutils example and compare it with #187. Done means forecasts with complete predicted and observed values are excluded by the intended rule, rather than silently dropped because trend contains NA.
索引モデルが issue の本文から書いたものです。
説明
Note to think through before raising upstream in scoringutils.
What happens
R/process-score.Rpasses the observed data toas_forecast_quantile()with thetrendcolumn attached.- scoringutils (2.1.2) infers the forecast unit from every column other than
predicted,observedandquantile_level, sotrendbecomes part of the forecast unit. score()callsclean_forecast(na.omit = TRUE), which runsna.omit()row-wise over all columns.trendis NA for each negative-count week (set to NA bydownload_obs()) and the three weeks after it. Every forecast targeting those four weeks is dropped from scoring, although its predicted and observed values are complete (apart from the negative week itself).- The only signal is the generic message "Some rows containing NA values may be removed. This is fine if not unexpected."
Example: FR cases has no scores for targets 2021-05-22 to 2021-06-12. In total there are 17 negative-count location-weeks (4 cases, 13 deaths).
Effect here: the primary (target-dated) exclusion of these forecasts happens through this side effect, not an explicit rule. See #187 and the handoff plan: pass forecast_unit explicitly in process-score.R and exclude on the covariate window in process_data().
Reprex
library(scoringutils)
library(data.table)
d <- data.table(
model = "m", location = rep(c("A", "B"), each = 3),
quantile_level = rep(c(0.25, 0.5, 0.75), 2),
predicted = c(1, 2, 3, 1, 2, 3), observed = 2,
trend = c(rep("Stable", 3), rep(NA, 3)) # covariate, not needed for scoring
)
fc <- as_forecast_quantile(d)
get_forecast_unit(fc) # "model" "location" "trend"
nrow(score(fc)) # 1: location B dropped, though predicted and observed are complete
nrow(score(as_forecast_quantile(d, forecast_unit = c("model", "location")))) # 2
Possible handling upstream (to think about)
| NA in | Option |
|---|---|
observed |
Drop the whole forecast (all its quantiles), and report it |
predicted |
Error or warn at the forecast level, naming the forecast, rather than dropping single quantile rows |
| A forecast-unit column | Keep it (NA is a valid group label), or error naming the column. Not a silent drop |
Related upstream issues
- epiforecasts/scoringutils#537 (open): NA message should give counts and columns. About the message, not which columns trigger removal.
- epiforecasts/scoringutils#1258 (open): row-wise NA removal splits or shrinks multivariate groups. Same mechanism.
- epiforecasts/scoringutils#731 (closed):
wis()now defaults tona.rm = FALSE.
None covers which columns should trigger removal, so a new upstream issue linking #537 and #1258 seems the right shape.
Scaffold for the upstream issue
Title: score() drops forecasts with NA in forecast-unit columns, not only predicted/observed
<!-- context: scoring EU hub forecasts with a covariate column attached -->
<!-- what happens: forecast unit inferred from all other columns; na.omit row-wise over all columns -->
<!-- consequence: complete forecasts excluded; only a generic message -->
<!-- reprex -->
<!-- proposal: table above -->
<!-- links: #537, #1258 -->
<!-- workaround: pass forecast_unit explicitly -->
- 主要言語
- R
- スター
- 6
- フォーク
- 0
- 平均マージ
- 7分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
epiforecasts/eval-by-method のほかの issue
-
Tweedie zero supportオープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
epiforecasts/eval-by-method#192 ·
-
code
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
epiforecasts/eval-by-method#201 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
epiforecasts/eval-by-method#196 ·
-
難易度 4/5 1〜2日 初心者へのやさしさ 30/100
epiforecasts/eval-by-method#195 · コメント 1 件 ·
-
Residualsオープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
epiforecasts/eval-by-method#194 ·
epiforecasts/eval-by-method の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
leppott/BioMonTools#162 ·
-
publications
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
epiforecasts/epiforecasts.github.io#161 ·
メンテナーはふだん 1 日以内に返信
-
Label `{sas}` chunk source as `sas` instead of `txt`, so it gets syntax highlighting対応中かも @michaelmayer2 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
microbiome/OMA#1031 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ThinkR-open/golem#1265 ·