Upload README.md with huggingface_hub
Browse files
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
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
`
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.
|