sallamsaka commited on
Commit
ec18ab9
·
verified ·
1 Parent(s): f0f4988

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +48 -14
README.md CHANGED
@@ -73,19 +73,53 @@ shift. Every fitted statistic — vocabulary, quantile edges, scalers — is fit
73
  on training patients only. 152 automated checks cover this, including a grep
74
  test that no module outside the time utility parses a timestamp.
75
 
76
- ## Reproducing
77
-
78
- The data is not included here. Rebuilding `predictions.csv` from the files in
79
- this repository, without any training:
80
-
81
- 1. Clone the code and install it:
82
- `git clone https://github.com/Sallamsaka/M31-Coding-Test`, then
83
- `pip install -r requirements.txt` inside it.
84
- 2. Copy the provided data into the repository root: the folders `train_val/` and
85
- `test/`, and the files `patient_splits.csv`, `target_conditions.csv` and
86
- `test_anchors.csv`.
87
- 3. Run `python -m src.reproduce --from-hub sallamsaka/M31-Coding-Test`. It downloads
88
- these model files, predicts every test patient, and checks the result against
89
- the submitted `predictions.csv`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
  Retraining everything from scratch is described in the GitHub README.
 
73
  on training patients only. 152 automated checks cover this, including a grep
74
  test that no module outside the time utility parses a timestamp.
75
 
76
+ ## Reproducing the predictions
77
+
78
+ The files on this page are enough to rebuild the submitted `predictions.csv`
79
+ exactly, without any training. The patient data is not included here: you need
80
+ the dataset provided with the M31 take-home.
81
+
82
+ **You need** Python 3.13, git, and that dataset.
83
+
84
+ 1. Get the code and install its dependencies:
85
+
86
+ ```
87
+ git clone https://github.com/Sallamsaka/M31-Coding-Test
88
+ cd M31-Coding-Test
89
+ pip install -r requirements.txt
90
+ ```
91
+
92
+ 2. Copy the provided data into that folder, so that it looks like this:
93
+
94
+ ```
95
+ M31-Coding-Test/
96
+ train_val/ provided CSV tables, train and validation patients
97
+ test/ provided CSV tables, test patients
98
+ patient_splits.csv
99
+ target_conditions.csv
100
+ test_anchors.csv
101
+ src/, outputs/, ... already there from the clone
102
+ ```
103
+
104
+ 3. Run:
105
+
106
+ ```
107
+ python -m src.reproduce --from-hub sallamsaka/M31-Coding-Test
108
+ ```
109
+
110
+ This downloads the model files from this page, builds each test patient's
111
+ features and event sequence, runs logistic regression, the boosted trees and
112
+ the three transformer seeds, averages and calibrates them, and writes
113
+ `outputs/predictions_reproduced.csv` (358 patients, 40 conditions).
114
+
115
+ 4. Check the last line it prints. The clone already contains the submitted
116
+ `outputs/predictions.csv`, and the script compares against it:
117
+
118
+ ```
119
+ max |reproduced - outputs/predictions.csv| = 7.40e-08 (MATCH)
120
+ ```
121
+
122
+ Anything below 1e-5 prints `MATCH`; the remaining difference is floating-point
123
+ rounding.
124
 
125
  Retraining everything from scratch is described in the GitHub README.