NSchuetz commited on
Commit
bee0fe1
·
verified ·
1 Parent(s): 306ab04

Add imputation/bootstrap/SCHEMA.md

Browse files
Files changed (1) hide show
  1. imputation/bootstrap/SCHEMA.md +79 -0
imputation/bootstrap/SCHEMA.md ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Imputation bootstrap reference — schema
2
+
3
+ The Track-2 bootstrap reference is two files:
4
+
5
+ ```
6
+ imputation/bootstrap/draws.parquet # ~107 MB zstd
7
+ imputation/bootstrap/draws.meta.json # provenance sidecar
8
+ ```
9
+
10
+ ## `draws.parquet`
11
+
12
+ One row per `(method, scenario, split, channel, channel_type,
13
+ subgroup_attr, subgroup_value, draw)`. Approximate size: **11,374,208
14
+ rows** for the canonical 1000-draw / 16-method / 6-scenario / test-split
15
+ run; `~107 MB` compressed (`zstd`).
16
+
17
+ | column | type | description |
18
+ |---|---|---|
19
+ | `method` | string (dict) | method identifier (16 values: `locf`, `mean`, `mode`, `linear`, `temporal_mean`, `temporal_mode`, `personalized_mean`, `personalized_mode`, `personalized_temporal_mean`, `brits`, `dlinear`, `dlinear_weekly`, `fedformer`, `timesnet`, `lsm2`, `lsm2_weekly_sparse`) |
20
+ | `scenario` | string (dict) | masking scenario (6): `random_noise`, `temporal_slice`, `signal_slice`, `sleep_gap`, `workout_gap`, `intensity_failure` |
21
+ | `split` | string (dict) | data split — `test` |
22
+ | `channel` | string (dict) | `ch_0`..`ch_18` (19 sensor channels) or `cat_collapsed:sleep` / `cat_collapsed:workouts` (collapsed-binary tasks) |
23
+ | `channel_type` | string (dict) | `continuous` (`ch_0`–`ch_6`), `binary` (`ch_7`–`ch_18`), or `binary_collapsed` (the `cat_collapsed:*` tasks) |
24
+ | `subgroup_attr` | string (dict) | `all` (global cell), `age_group`, or `sex` |
25
+ | `subgroup_value` | string (dict) | `all` for the global cell; otherwise the subgroup level (age bucket, sex value, or `unknown`) |
26
+ | `draw` | int32 | bootstrap-draw index in `[0, n_boot)` |
27
+ | `E` | float32 | absolute error for this draw, user-macro reduced |
28
+ | `R` | float32 | paired ratio vs baseline (`locf`) for this draw, geomean over users; `1.0` exactly for the baseline-vs-self row, `NaN` if undefined |
29
+ | `rank` | float32 | cross-method rank for this draw, averaged over the resampled cohort |
30
+
31
+ ### Value semantics
32
+
33
+ - **`E`** — per-draw user-macro error. Per channel: continuous = per-user MAE, then `nanmean` over resampled users; binary = `1 − AUC` per user, then `nanmean` over users; `binary_collapsed` = per-user `nanmean(1 − AUC)` over the category's channels, then `nanmean` over users.
34
+ - **`R`** — per-draw paired ratio. Per (user, task) the ratio is `clip(E_method / E_baseline, 0.01, 100)`; per draw, `R = exp(nanmean(log(ratio)))` over resampled users. Binary `E` is `ε = 0.005` floored before forming the ratio so perfect-AUC users contribute finite values.
35
+ - **`rank`** — per-draw cross-method rank. Per (user, task) the rank is `rankdata(E_methods, method="average", ascending=True)` (lower E → rank 1); per draw, `rank = nanmean` over resampled users.
36
+
37
+ NaN appears where a task is structurally absent (e.g. binary tasks in the
38
+ `EXCLUDE_BINARY_SCENARIOS` set: `sleep_gap`, `workout_gap`,
39
+ `intensity_failure`).
40
+
41
+ ## `draws.meta.json`
42
+
43
+ Side-car metadata, written next to `draws.parquet`. Schema:
44
+
45
+ ```jsonc
46
+ {
47
+ "n_boot": 1000,
48
+ "seed": 42,
49
+ "splits": ["test"],
50
+ "scenarios": ["intensity_failure", "random_noise", "signal_slice",
51
+ "sleep_gap", "temporal_slice", "workout_gap"],
52
+ "methods": ["mean", "mode", "locf", ...], // 16 entries
53
+ "method_dirs": {"locf": "/path/to/pairs", ...}, // source pair dirs (cluster-local)
54
+ "include_auc": true,
55
+ "include_fairness": true,
56
+ "age_bins": [18, 30, 40, 50, 60],
57
+ "exclude_unknown": false,
58
+ "elapsed_seconds": 3531.6,
59
+ "n_rows": 11374208,
60
+ "git_commit": "06e4cbda...", // code-repo commit at generation
61
+ "timestamp": "2026-06-19T03:24:21.860842Z",
62
+ "argv": [...] // exact invocation
63
+ }
64
+ ```
65
+
66
+ ## Conventions
67
+
68
+ - Evaluated against the canonical split `sharable_users_seed42_2026` (`test`).
69
+ - Track-2 baseline for skill / fairness: `locf`.
70
+ - Format: single Parquet, dictionary-encoded categoricals, `float32` errors, `int32` draw index, `zstd` compression.
71
+ - Resamples are paired across methods — same `boot_idx` matrix per split, so `R` and `rank` are valid per-draw comparisons.
72
+
73
+ ## Tracks
74
+
75
+ | dir | track | status |
76
+ |---|---|---|
77
+ | `imputation/bootstrap/` | Track 2 — Imputation (above) | live |
78
+ | `forecasting/bootstrap/` | Track 3 — Forecasting | added later |
79
+ | `downstream/bootstrap/` | Track 1 — Outcome Prediction | added later |