NSchuetz commited on
Commit
7877f5b
·
verified ·
1 Parent(s): f6cfa38

docs(forecasting): add SCHEMA.md with fallback_rate sidecar key

Browse files
Files changed (1) hide show
  1. forecasting/SCHEMA.md +129 -0
forecasting/SCHEMA.md ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Forecasting submission substrate — schema
2
+
3
+ This is the schema of the file a **submitter uploads** for the Track-3
4
+ (forecasting) leaderboard: one per-method, per-user metric parquet plus a small
5
+ display sidecar.
6
+
7
+ ```
8
+ forecasting/<method>.parquet # per-user substrate (this file)
9
+ forecasting/<method>.meta.json # display sidecar (below)
10
+ ```
11
+
12
+ The parquet is produced by the evaluation run — pass both `output_dir=` and
13
+ `method_name="<method>"` to `openmhc.evaluate_forecasting` and it writes
14
+ `per_user_errors.parquet` with the `model` column set to `<method>`. Upload that
15
+ file verbatim (renamed to `<method>.parquet`); do not hand-author it. The
16
+ maintainers concatenate every `forecasting/*.parquet` and recompute paired skill,
17
+ fair skill, and average rank against the `seasonal_naive` baseline during
18
+ ingestion, so the columns and dtypes below must match exactly.
19
+
20
+ > **`method_name` is required and must equal your `<method>` stem.** It defaults
21
+ > to `"custom"`, and ingestion **groups rows by the `model` column** — so a
22
+ > submission left at the default collides with every other default submission and
23
+ > is scored under the wrong identity. This is the `method_name` argument to
24
+ > `evaluate_forecasting` (which sets the parquet column), *not* the cosmetic
25
+ > `to_submission_yaml(method_name=...)` display name. It must differ from the
26
+ > baseline name `seasonal_naive`.
27
+
28
+ > For the separate **bootstrap reference** frame (per-draw CIs, not the
29
+ > submission file), see [`bootstrap/SCHEMA.md`](bootstrap/SCHEMA.md).
30
+
31
+ ## `<method>.parquet`
32
+
33
+ One row per `(model, group, metric, channel_idx, channel_name, user_id)`. Single
34
+ Parquet, dictionary-encoded string columns, **`float64`** metric value, `zstd`
35
+ compression. Unlike Track 2 (which stores the error `E_per_user`), the forecasting
36
+ substrate stores the **raw** per-user metric value, so one file serves all three
37
+ reducers — skill and fairness convert it to an error on load, rank uses it
38
+ directly.
39
+
40
+ | column | type | description |
41
+ |---|---|---|
42
+ | `model` | string (dict) | your method identifier; **must equal the `<method>` filename stem** — set it via `evaluate_forecasting(method_name="<method>")` (defaults to `"custom"`) |
43
+ | `group` | string (dict) | `continuous` (`ch 0`–`6`, scored on `mae`) or `binary` (`ch 7`–`18`, scored on `auroc`) |
44
+ | `metric` | string (dict) | scored metric: `mae` (continuous) or `auroc` (binary) |
45
+ | `channel_idx` | int16 | sensor channel index (0–18) |
46
+ | `channel_name` | string (dict) | human-readable channel name |
47
+ | `user_id` | string (dict) | participant id from the canonical split |
48
+ | `metric_value` | float64 | RAW per-user metric, micro-pooled over the user's forecast windows (`Σcell / Σcount`) |
49
+ | `n_values` | int64 | finite horizon-cell count behind `metric_value` |
50
+
51
+ ### Value semantics
52
+
53
+ - **`metric_value`** — the raw per-user metric, *before* any cross-user reduction
54
+ and *before* any error conversion. Continuous channels: per-user MAE. Binary
55
+ channels: per-user AUROC. Stored at **float64** for byte-exact reproduction of
56
+ the published aggregates.
57
+ - **On load the maintainers convert to an error**: continuous `error =
58
+ metric_value` (MAE, lower is better); binary `error = max(1 − auroc, 0.005)`
59
+ (the `0.005` floor keeps perfect-AUROC users finite). Rank uses `metric_value`
60
+ directly. Skill is the paired geomean of clipped per-user error ratios vs the
61
+ baseline.
62
+ - **Structurally-absent cells are omitted, not NaN-filled** — a `(channel,
63
+ metric, user)` with no finite horizon cells simply has no row; the grid is not a
64
+ full cartesian product. The shipped Seasonal-Naive baseline
65
+ (`src/openmhc/data/baselines/forecasting_seasonal_naive_per_user_errors.parquet`)
66
+ is the canonical shape your submission should mirror.
67
+
68
+ ### No subgroup rows — fairness is joined server-side
69
+
70
+ Unlike Track 2, the forecasting substrate is keyed by `user_id` only and carries
71
+ **no `subgroup_attr` / `subgroup_value` columns**. The fairness skill score is
72
+ computed maintainer-side by joining demographics (`age_group`, `sex`) onto
73
+ `user_id` from the private label tables, so submitters do **not** ship subgroup
74
+ rows — `evaluate_forecasting` emits exactly the columns above.
75
+
76
+ ## `<method>.meta.json`
77
+
78
+ Tiny display sidecar the leaderboard reads to render the row:
79
+
80
+ ```jsonc
81
+ {
82
+ "display_name": "My Forecaster", // shown in the leaderboard
83
+ "type": "Deep Learning", // category label
84
+ "submitter": "Stanford CS", // lab / team
85
+ "subtrack": "other", // Track 3 has no single-day/long-context split
86
+ "fallback_rate": 0.0 // Seasonal-Naive substitution fraction (see below)
87
+ }
88
+ ```
89
+
90
+ ### `fallback_rate`
91
+
92
+ Scalar in `[0, 1]`. The run's `overall_fallback_rate` (mirrors
93
+ `openmhc._results.ForecastingResults.overall_fallback_rate`): the fraction of
94
+ forecast cells the model emitted as non-finite (NaN), which the harness then
95
+ substituted with the **Seasonal-Naive** baseline before scoring.
96
+
97
+ - **`0.0`** — every forecast cell was finite; the harness never substituted.
98
+ - **`>0`** — the model returned NaN at that fraction of forecast cells and the
99
+ harness filled them with Seasonal-Naive. Treat headline scores cautiously when
100
+ `fallback_rate > ~5%`, since the metric is inflated with baseline performance
101
+ on the substituted positions.
102
+
103
+ The field is added to the sidecar by `tools/upload_leaderboard_substrate.py` in
104
+ one of two ways:
105
+
106
+ 1. Explicit: `--fallback-rate FLOAT`
107
+ 2. Auto: `--results-json PATH` — the tool reads the run's `results.json` and
108
+ extracts the top-level `overall_fallback_rate`.
109
+
110
+ Existing sidecar fields are preserved on update (the tool fetches the current
111
+ sidecar from HF and merges only the provided fields).
112
+
113
+ ## Conventions
114
+
115
+ - Evaluated against the canonical split `sharable_users_seed42_2026` (`test`).
116
+ - Track-3 baseline for skill / fairness: `seasonal_naive` (server-side; do not
117
+ submit it).
118
+ - Scored set: `mae` (continuous channels 0–6) + `auroc` (binary channels 7–18);
119
+ ratio clip `[0.01, 100]`; within-user aggregation `micro`; unit `user`.
120
+ - Fairness disparity primitive: mean absolute pairwise difference (MAPD).
121
+ - Must use the standard evaluation protocol — canonical dataset version, split
122
+ file, sample-index, and horizon (24 h).
123
+
124
+ ## Uploaded with
125
+
126
+ Submitters open a PR on the dataset with `HfApi().upload_folder(...,
127
+ create_pr=True)` (see the repo README, "Submit to the Leaderboard").
128
+ Maintainers can use `tools/upload_leaderboard_substrate.py` in the
129
+ [code repo](https://github.com/AshleyLab/myheartcounts-dataset).