meds-algorithm-eic-ar 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- eic_ar/__init__.py +6 -0
- eic_ar/__main__.py +91 -0
- eic_ar/classifier.py +69 -0
- eic_ar/config.py +110 -0
- eic_ar/eic_ar.py +764 -0
- eic_ar/presets/demo_False.yaml +2 -0
- eic_ar/presets/demo_True.yaml +15 -0
- eic_ar/resources/algorithms/finetune/model.yaml +30 -0
- eic_ar/resources/algorithms/probe/model.yaml +31 -0
- eic_ar/resources/algorithms/supervised/model.yaml +27 -0
- eic_ar/resources/algorithms/zero_shot_materialized/model.yaml +31 -0
- eic_ar/resources/runs/run.yaml +27 -0
- meds_algorithm_eic_ar-0.1.0.dist-info/METADATA +193 -0
- meds_algorithm_eic_ar-0.1.0.dist-info/RECORD +17 -0
- meds_algorithm_eic_ar-0.1.0.dist-info/WHEEL +4 -0
- meds_algorithm_eic_ar-0.1.0.dist-info/entry_points.txt +2 -0
- meds_algorithm_eic_ar-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# MEDS-DEV demo=true smoke-test preset, mirroring MEDS_EIC_AR's own demo mode. Not a scientific setting.
|
|
2
|
+
# Thresholds: MEICAR_process_data do_demo=True. Architecture: lightning_module/model/demo.yaml.
|
|
3
|
+
# Sequence length, batch size and samples: _demo_pretrain.yaml, inference/demo.yaml.
|
|
4
|
+
min_subjects_per_code: 2
|
|
5
|
+
min_events_per_subject: 1
|
|
6
|
+
num_hidden_layers: 2
|
|
7
|
+
num_attention_heads: 2
|
|
8
|
+
reference_attention_head_dim: 4
|
|
9
|
+
max_seq_len: 20
|
|
10
|
+
batch_size: 2
|
|
11
|
+
max_steps: 10
|
|
12
|
+
task_max_steps: 10
|
|
13
|
+
n_trajectories: 2
|
|
14
|
+
precision: 32-true
|
|
15
|
+
num_dataloader_workers: 0
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## MEDS-DEV descriptor for MEDS-EIC-AR. This retains the established command-slot interface.
|
|
7
|
+
## Each MEDS-DEV run directory {output_dir} holds this run's artifacts as sibling subdirectories (data/,
|
|
8
|
+
## pretrained/, algorithm/, embeddings/ or trajectories/, predictions/): MEDS-DEV keeps its own cmd.sh and .done marker in
|
|
9
|
+
## {output_dir}, and artifacts are published by publishing their own destination directory.
|
|
10
|
+
## Every command passes config_file="$(eic-ar preset demo_{demo})": demo=false selects the
|
|
11
|
+
## source-defined defaults (src/eic_ar/presets/demo_False.yaml), demo=true upstream's own demo-mode
|
|
12
|
+
## smoke settings (demo_True.yaml). The same configuration is used by every step of a run.
|
|
13
|
+
metadata:
|
|
14
|
+
description: "MEDS Everything-is-code autoregressive model (MEDS_EIC_AR) with zero-shot materialized trajectories and discriminative supervised, finetune and probe heads."
|
|
15
|
+
contacts:
|
|
16
|
+
- name: "Florent Pollet"
|
|
17
|
+
email: "flo1.raymond@gmail.com"
|
|
18
|
+
|
|
19
|
+
commands:
|
|
20
|
+
unsupervised:
|
|
21
|
+
train: |-
|
|
22
|
+
eic-ar preprocess_data --profile finetune config_file="$(eic-ar preset demo_{demo})" external_meds_dir={dataset_dir} external_predicates_file={predicates_path} output_data_dir={output_dir}/data do_overwrite=true
|
|
23
|
+
eic-ar pretrain --profile finetune config_file="$(eic-ar preset demo_{demo})" input_data_dir={output_dir}/data output_pretrained_algorithm_dir={output_dir}/pretrained
|
|
24
|
+
supervised:
|
|
25
|
+
train: |-
|
|
26
|
+
eic-ar train_finetune --profile finetune config_file="$(eic-ar preset demo_{demo})" input_data_dir={model_initialization_dir}/data input_pretrained_algorithm_dir={model_initialization_dir}/pretrained external_labels_dir={labels_dir} output_finetuned_algorithm_dir={output_dir}/algorithm
|
|
27
|
+
|
|
28
|
+
predict: |-
|
|
29
|
+
eic-ar predict_finetune --profile finetune config_file="$(eic-ar preset demo_{demo})" input_data_dir="$(meds-algorithm-resolve-input {model_initialization_dir}/algorithm input_data_dir)" input_finetuned_algorithm_dir={model_initialization_dir}/algorithm external_index_dir={labels_dir} splits=[{split}] output_predictions_dir={output_dir}/predictions do_overwrite=true external_evaluation_labels_dir={labels_dir}
|
|
30
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## MEDS-DEV descriptor for MEDS-EIC-AR. This retains the established command-slot interface.
|
|
7
|
+
## Each MEDS-DEV run directory {output_dir} holds this run's artifacts as sibling subdirectories (data/,
|
|
8
|
+
## pretrained/, algorithm/, embeddings/ or trajectories/, predictions/): MEDS-DEV keeps its own cmd.sh and .done marker in
|
|
9
|
+
## {output_dir}, and artifacts are published by publishing their own destination directory.
|
|
10
|
+
## Every command passes config_file="$(eic-ar preset demo_{demo})": demo=false selects the
|
|
11
|
+
## source-defined defaults (src/eic_ar/presets/demo_False.yaml), demo=true upstream's own demo-mode
|
|
12
|
+
## smoke settings (demo_True.yaml). The same configuration is used by every step of a run.
|
|
13
|
+
metadata:
|
|
14
|
+
description: "MEDS Everything-is-code autoregressive model (MEDS_EIC_AR) with zero-shot materialized trajectories and discriminative supervised, finetune and probe heads."
|
|
15
|
+
contacts:
|
|
16
|
+
- name: "Florent Pollet"
|
|
17
|
+
email: "flo1.raymond@gmail.com"
|
|
18
|
+
|
|
19
|
+
commands:
|
|
20
|
+
unsupervised:
|
|
21
|
+
train: |-
|
|
22
|
+
eic-ar preprocess_data --profile probe config_file="$(eic-ar preset demo_{demo})" external_meds_dir={dataset_dir} external_predicates_file={predicates_path} output_data_dir={output_dir}/data do_overwrite=true
|
|
23
|
+
eic-ar pretrain --profile probe config_file="$(eic-ar preset demo_{demo})" input_data_dir={output_dir}/data output_pretrained_algorithm_dir={output_dir}/pretrained
|
|
24
|
+
supervised:
|
|
25
|
+
train: |-
|
|
26
|
+
eic-ar infer_embeddings --profile probe config_file="$(eic-ar preset demo_{demo})" input_data_dir={model_initialization_dir}/data input_pretrained_algorithm_dir={model_initialization_dir}/pretrained external_index_dir={labels_dir} splits=[train,tuning,held_out] output_embeddings_dir={output_dir}/embeddings do_overwrite=true
|
|
27
|
+
eic-ar train_probe --profile probe config_file="$(eic-ar preset demo_{demo})" external_labels_dir={labels_dir} input_embeddings_dir={output_dir}/embeddings output_probe_algorithm_dir={output_dir}/algorithm
|
|
28
|
+
|
|
29
|
+
predict: |-
|
|
30
|
+
eic-ar predict_probe --profile probe config_file="$(eic-ar preset demo_{demo})" input_embeddings_dir="$(meds-algorithm-resolve-input {model_initialization_dir}/algorithm input_embeddings_dir)" input_probe_algorithm_dir={model_initialization_dir}/algorithm external_index_dir={labels_dir} splits=[{split}] output_predictions_dir={output_dir}/predictions do_overwrite=true external_evaluation_labels_dir={labels_dir}
|
|
31
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## MEDS-DEV descriptor for MEDS-EIC-AR. This retains the established command-slot interface.
|
|
7
|
+
## Each MEDS-DEV run directory {output_dir} holds this run's artifacts as sibling subdirectories (data/,
|
|
8
|
+
## pretrained/, algorithm/, embeddings/ or trajectories/, predictions/): MEDS-DEV keeps its own cmd.sh and .done marker in
|
|
9
|
+
## {output_dir}, and artifacts are published by publishing their own destination directory.
|
|
10
|
+
## Every command passes config_file="$(eic-ar preset demo_{demo})": demo=false selects the
|
|
11
|
+
## source-defined defaults (src/eic_ar/presets/demo_False.yaml), demo=true upstream's own demo-mode
|
|
12
|
+
## smoke settings (demo_True.yaml). The same configuration is used by every step of a run.
|
|
13
|
+
metadata:
|
|
14
|
+
description: "MEDS Everything-is-code autoregressive model (MEDS_EIC_AR) with zero-shot materialized trajectories and discriminative supervised, finetune and probe heads."
|
|
15
|
+
contacts:
|
|
16
|
+
- name: "Florent Pollet"
|
|
17
|
+
email: "flo1.raymond@gmail.com"
|
|
18
|
+
|
|
19
|
+
commands:
|
|
20
|
+
supervised:
|
|
21
|
+
train: |-
|
|
22
|
+
eic-ar preprocess_data --profile supervised config_file="$(eic-ar preset demo_{demo})" external_meds_dir={dataset_dir} external_predicates_file={predicates_path} output_data_dir={output_dir}/data do_overwrite=true
|
|
23
|
+
eic-ar train_supervised --profile supervised config_file="$(eic-ar preset demo_{demo})" input_data_dir={output_dir}/data external_labels_dir={labels_dir} output_supervised_algorithm_dir={output_dir}/algorithm
|
|
24
|
+
|
|
25
|
+
predict: |-
|
|
26
|
+
eic-ar predict_supervised --profile supervised config_file="$(eic-ar preset demo_{demo})" input_data_dir="$(meds-algorithm-resolve-input {model_initialization_dir}/algorithm input_data_dir)" input_supervised_algorithm_dir={model_initialization_dir}/algorithm external_index_dir={labels_dir} splits=[{split}] output_predictions_dir={output_dir}/predictions do_overwrite=true external_evaluation_labels_dir={labels_dir}
|
|
27
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## MEDS-DEV descriptor for MEDS-EIC-AR. This retains the established command-slot interface.
|
|
7
|
+
## Each MEDS-DEV run directory {output_dir} holds this run's artifacts as sibling subdirectories (data/,
|
|
8
|
+
## pretrained/, algorithm/, embeddings/ or trajectories/, predictions/): MEDS-DEV keeps its own cmd.sh and .done marker in
|
|
9
|
+
## {output_dir}, and artifacts are published by publishing their own destination directory.
|
|
10
|
+
## Zero-shot commands receive the task itself through {task_criteria_path}, which needs the MEDS-DEV
|
|
11
|
+
## passthrough described in SPEC.md section 2.4 (the analogue of {predicates_path}).
|
|
12
|
+
## Every command passes config_file="$(eic-ar preset demo_{demo})": demo=false selects the
|
|
13
|
+
## source-defined defaults (src/eic_ar/presets/demo_False.yaml), demo=true upstream's own demo-mode
|
|
14
|
+
## smoke settings (demo_True.yaml). The same configuration is used by every step of a run.
|
|
15
|
+
metadata:
|
|
16
|
+
description: "MEDS Everything-is-code autoregressive model (MEDS_EIC_AR) with zero-shot materialized trajectories and discriminative supervised, finetune and probe heads."
|
|
17
|
+
contacts:
|
|
18
|
+
- name: "Florent Pollet"
|
|
19
|
+
email: "flo1.raymond@gmail.com"
|
|
20
|
+
|
|
21
|
+
commands:
|
|
22
|
+
unsupervised:
|
|
23
|
+
train: |-
|
|
24
|
+
eic-ar preprocess_data --profile zero_shot_materialized config_file="$(eic-ar preset demo_{demo})" external_meds_dir={dataset_dir} external_predicates_file={predicates_path} output_data_dir={output_dir}/data do_overwrite=true
|
|
25
|
+
eic-ar pretrain --profile zero_shot_materialized config_file="$(eic-ar preset demo_{demo})" input_data_dir={output_dir}/data output_pretrained_algorithm_dir={output_dir}/pretrained
|
|
26
|
+
supervised:
|
|
27
|
+
train: null
|
|
28
|
+
predict: |-
|
|
29
|
+
eic-ar infer_trajectories --profile zero_shot_materialized config_file="$(eic-ar preset demo_{demo})" input_data_dir={model_initialization_dir}/data input_pretrained_algorithm_dir={model_initialization_dir}/pretrained external_index_dir={labels_dir} splits=[{split}] output_trajectories_dir={output_dir}/trajectories do_overwrite=true
|
|
30
|
+
eic-ar predict_zero_shot_materialized --profile zero_shot_materialized config_file="$(eic-ar preset demo_{demo})" input_data_dir={model_initialization_dir}/data external_meds_dir={dataset_dir} input_trajectories_dir={output_dir}/trajectories external_index_dir={labels_dir} external_task_criteria_file={task_criteria_path} external_predicates_file={predicates_path} splits=[{split}] output_predictions_dir={output_dir}/predictions do_overwrite=true external_evaluation_labels_dir={labels_dir}
|
|
31
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Prototype: one config for local subprocesses or dependent Submitit SLURM jobs.
|
|
2
|
+
# Shared field/resource defaults come from meds-algorithm, not a copied schema.
|
|
3
|
+
defaults:
|
|
4
|
+
- meds_run
|
|
5
|
+
- _self_
|
|
6
|
+
|
|
7
|
+
profile: ??? # Choose one of: supervised, finetune, probe, zero_shot_materialized
|
|
8
|
+
execution: local
|
|
9
|
+
output_dir: ??? # New directory for this run; relative paths use the invocation's working directory.
|
|
10
|
+
|
|
11
|
+
inputs:
|
|
12
|
+
meds_dir: null # Required by preprocessing and materialized zero-shot prediction.
|
|
13
|
+
index_dir: null # Required by inference and prediction.
|
|
14
|
+
labels_dir: null # Required by supervised/finetune/probe training.
|
|
15
|
+
predicates_file: null # Supply the dataset predicates expected by this algorithm.
|
|
16
|
+
task_criteria_file: null # Required when selecting a zero-shot profile.
|
|
17
|
+
|
|
18
|
+
# Add only algorithm settings that differ from the concrete Config class's defaults.
|
|
19
|
+
algorithm: {}
|
|
20
|
+
|
|
21
|
+
# Optional overrides, e.g. resources.compute.gpus_per_node=1 and its partition/account.
|
|
22
|
+
# Both resource presets default to CPUs; choose resources appropriate for this algorithm.
|
|
23
|
+
# resources:
|
|
24
|
+
# compute:
|
|
25
|
+
# gpus_per_node: 1
|
|
26
|
+
# partition: gpu
|
|
27
|
+
# timeout_min: 240
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: meds-algorithm-eic-ar
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MEDS Everything-is-code autoregressive model (MEDS_EIC_AR) with zero-shot materialized trajectories and discriminative supervised, finetune and probe heads.
|
|
5
|
+
Project-URL: Repository, https://github.com/florian6973/meds-algo-eic-ar-dual
|
|
6
|
+
Author-email: Florent Pollet <flo1.raymond@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Python: <3.14,>=3.11
|
|
10
|
+
Requires-Dist: meds-algorithm[data]==0.4.0a7
|
|
11
|
+
Requires-Dist: meds-eic-ar==0.5.1
|
|
12
|
+
Requires-Dist: pyyaml>=6
|
|
13
|
+
Requires-Dist: scikit-learn>=1.4
|
|
14
|
+
Provides-Extra: orchestration
|
|
15
|
+
Requires-Dist: meds-algorithm[orchestration]==0.4.0a7; extra == 'orchestration'
|
|
16
|
+
Provides-Extra: test
|
|
17
|
+
Requires-Dist: meds-algorithm[conformance]==0.4.0a7; extra == 'test'
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# MEDS-EIC-AR
|
|
21
|
+
|
|
22
|
+
## Python API and named command
|
|
23
|
+
|
|
24
|
+
The implementation is `src/eic_ar/eic_ar.py`, with configuration in `config.py`.
|
|
25
|
+
Both concrete classes are public package exports:
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
from eic_ar import EICAR, EICARConfig
|
|
29
|
+
|
|
30
|
+
algorithm = EICAR(EICARConfig())
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Run typed requests through `meds_algorithm.StepRunner.run(...)` so validation, measurements and
|
|
34
|
+
publication apply. Calling an implementation method directly bypasses that execution contract.
|
|
35
|
+
After installation, the algorithm's own `eic-ar` command runs the CLI:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
eic-ar commands --profile supervised
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
MEDS Everything-is-code autoregressive model (MEDS_EIC_AR) with zero-shot materialized trajectories and discriminative supervised, finetune and probe heads.
|
|
42
|
+
|
|
43
|
+
This repository declares the **`supervised, finetune, probe, zero_shot_materialized`** profiles under version 4 of the minimal MEDS algorithm
|
|
44
|
+
contract. The contract standardizes MEDS input, command meanings and arguments, artifact envelopes,
|
|
45
|
+
final predictions, measurements, MEDS-DEV packaging, and operational interfaces. The algorithm owns every
|
|
46
|
+
computational choice and every intermediate payload.
|
|
47
|
+
|
|
48
|
+
## Algorithm profile commands
|
|
49
|
+
|
|
50
|
+
- `supervised`: `preprocess_data → train_supervised → predict_supervised`
|
|
51
|
+
- `finetune`: `preprocess_data → pretrain → train_finetune → predict_finetune`
|
|
52
|
+
- `probe`: `preprocess_data → pretrain → infer_embeddings → train_probe → predict_probe`
|
|
53
|
+
- `zero_shot_materialized`: `preprocess_data → pretrain → infer_trajectories → predict_zero_shot_materialized`
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
eic-ar profiles
|
|
57
|
+
eic-ar commands --profile supervised
|
|
58
|
+
eic-ar <step> --profile <profile> key=value ...
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Each profile has `algorithms/<profile>/model.yaml`. Multiple profiles share one Python package and one
|
|
62
|
+
registry; select one explicitly for each run. `STUB_PROFILES` tracks implementation status separately.
|
|
63
|
+
Read [Software contract](SPEC.md) for exact class responsibilities and step inputs.
|
|
64
|
+
|
|
65
|
+
Intermediate artifacts may be tensors, files, databases, external-system references, or any other
|
|
66
|
+
implementation-owned representation. Generic tests inspect only their `manifest.yaml` envelopes. They
|
|
67
|
+
must not assume batches, Lightning, PyTorch, Parquet intermediate data, or iteration order.
|
|
68
|
+
|
|
69
|
+
## Profile runner (prototype)
|
|
70
|
+
|
|
71
|
+
Install `uv sync --extra orchestration --extra test`, then fill the input paths and new output directory
|
|
72
|
+
in `configs/runs/run.yaml`. Algorithm settings belong under `algorithm`; core validates them using
|
|
73
|
+
this repository's concrete Config class.
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
uv run eic-ar run --dry-run
|
|
77
|
+
uv run eic-ar run execution=local
|
|
78
|
+
# Use a NEW output_dir and configure your cluster's resources before submission:
|
|
79
|
+
uv run eic-ar run execution=slurm output_dir=/runs/new-cluster-run
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
A dry run prints all resolved arguments, paths, configuration and resources without writing files or
|
|
83
|
+
submitting jobs. Local execution uses fresh subprocesses; Submitit submits separate dependent SLURM
|
|
84
|
+
jobs. See the [shared runner guide](https://meds-algorithm.readthedocs.io/en/latest/running/#profile-runner-prototype)
|
|
85
|
+
for stage subsets, artifact reuse, resource configuration and prototype limitations. The existing
|
|
86
|
+
per-step CLI and shell launcher remain available for comparison. This prototype does not implement
|
|
87
|
+
Hydra multirun, multi-node training or checkpoint/resume.
|
|
88
|
+
|
|
89
|
+
## Publishing this algorithm
|
|
90
|
+
|
|
91
|
+
Follow [the release guide](RELEASING.md) for package metadata, one-time PyPI Trusted Publisher setup,
|
|
92
|
+
installed-wheel checks, and version-tag publication. All profiles ship in the `meds-algorithm-eic-ar`
|
|
93
|
+
distribution. Tests run in CI; publishing is an explicit workflow dispatch after implementation.
|
|
94
|
+
|
|
95
|
+
## Inputs and predicates
|
|
96
|
+
|
|
97
|
+
- `external_meds_dir` is the standard MEDS dataset boundary.
|
|
98
|
+
- `external_index_dir` supplies only `(subject_id, prediction_time)` to inference and scoring.
|
|
99
|
+
- `external_labels_dir` supplies permitted training targets or explicit in-context examples.
|
|
100
|
+
- `external_evaluation_labels_dir`, when supplied, is used only to attach truth after scores are fixed.
|
|
101
|
+
- `external_predicates_file` supplies dataset-specific predicates when useful. For MIMIC-IV, reuse the
|
|
102
|
+
predicates from MEDS-DEV. This repository decides whether and how to interpret them.
|
|
103
|
+
|
|
104
|
+
A command that consumes predicates records their absolute path and SHA-256 digest in its manifest.
|
|
105
|
+
Predicates do not imply a standard feature representation.
|
|
106
|
+
|
|
107
|
+
## Implementing the algorithm
|
|
108
|
+
|
|
109
|
+
Read [AGENTS.md](AGENTS.md), [SPEC.md](SPEC.md), and
|
|
110
|
+
[docs/IMPLEMENTATION_GUIDE.md](docs/IMPLEMENTATION_GUIDE.md) completely before changing implementation
|
|
111
|
+
files. The implementation source recorded when this repository was generated is:
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
https://github.com/mmcdermott/MEDS_EIC_AR
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The algorithm-owned surface is `src/eic_ar/eic_ar.py` (the typed algorithm), `src/eic_ar/config.py`
|
|
118
|
+
(its immutable configuration), `algorithms/<profile>/model.yaml`, and
|
|
119
|
+
`tests/e2e.py`. Implement the selected profile methods, define exact intermediate compatibility checks in
|
|
120
|
+
`validate_inputs`,
|
|
121
|
+
finalize MEDS-DEV command strings, and complete the report. Remove a profile from `STUB_PROFILES` only after it runs end to end. Complete every declared profile.
|
|
122
|
+
|
|
123
|
+
For each generated test and its purpose, read [the test guide](docs/TESTING.md).
|
|
124
|
+
|
|
125
|
+
## Configuration and execution ownership
|
|
126
|
+
|
|
127
|
+
Declare typed fields/defaults in `EICARConfig`, with `validate()` for constraints. Pass
|
|
128
|
+
`config_file=/path/config.yaml` to a step for a JSON/YAML values mapping; unknown fields fail. Core saves
|
|
129
|
+
the complete resolved config and original typed request as `config.json` and `request.json` in each
|
|
130
|
+
published artifact. These JSON envelopes can be reloaded with the corresponding explicit classes.
|
|
131
|
+
|
|
132
|
+
Algorithm methods receive typed requests, write payloads into `request.output.directory` (staging), and
|
|
133
|
+
return `PayloadMetadata`. `create_repository().run(...)` constructs a fresh algorithm and delegates to
|
|
134
|
+
core's runner. It owns measurements, prediction validation, optional post-score truth attachment,
|
|
135
|
+
metadata and publication. Never publish from inside algorithm methods or write the reserved metadata files.
|
|
136
|
+
Reopen fitted artifacts on each step. Test config/request round trips and execution in a fresh process.
|
|
137
|
+
|
|
138
|
+
## Verification
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
uv run pytest -rs
|
|
142
|
+
uv run pytest -m meds_dev -rs
|
|
143
|
+
uv run pytest -m real_data -rs
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
- The default suite runs the local end-to-end adapter and contract tests.
|
|
147
|
+
- `meds_dev` registers `algorithms/<profile>/model.yaml`, installs this repository from `requirements.txt` in an isolated
|
|
148
|
+
environment, and executes MEDS-DEV's real command slots.
|
|
149
|
+
- `real_data` runs the full selected algorithm profile on the MEDS-DEV MIMIC-IV demo, the pinned
|
|
150
|
+
`mortality/in_icu/first_24h` task, and MEDS-DEV's
|
|
151
|
+
MIMIC predicates. Set `MEDS_DEMO_DIR` to reuse an existing demo and `MEDS_DEV_DIR` to reuse a checkout.
|
|
152
|
+
|
|
153
|
+
Automatic provisioning pins MEDS-DEV PR #330's tested commit, which has the `{predicates_path}`
|
|
154
|
+
passthrough (PR #325) and the
|
|
155
|
+
`{task_criteria_path}` passthrough this zero-shot algorithm needs. Set `MEDS_DEV_REF` to use another
|
|
156
|
+
revision containing those capabilities. A checkout supplied through `MEDS_DEV_DIR` is checked and fails
|
|
157
|
+
clearly if it cannot populate them.
|
|
158
|
+
|
|
159
|
+
Both integration tiers explicitly `algorithm_stub`-skip until implementation is complete. A completed port
|
|
160
|
+
must have zero `algorithm_stub` skips and must account for every other skip using `-rs` output.
|
|
161
|
+
|
|
162
|
+
These commands are gates, not an unordered checklist. Follow the canonical staged workflow in
|
|
163
|
+
[docs/IMPLEMENTATION_GUIDE.md](docs/IMPLEMENTATION_GUIDE.md): local, MEDS-DEV, pre-demo report and human
|
|
164
|
+
review, MIMIC-IV demo, demo report and human review, authorized full-data run, then final report and GitHub
|
|
165
|
+
synchronization. Full-data cluster jobs run only from a clean, pushed commit and use the reviewed shared
|
|
166
|
+
task bundle for the selected dataset (for example, MIMIC-IV or NWICU in MEDS format), built upstream from
|
|
167
|
+
clinical ACES tasks or randomly sampled code-by-horizon tasks. The provided `real_data` test remains the MIMIC-IV demo regardless of that choice.
|
|
168
|
+
|
|
169
|
+
Final predictions must conform to MEDS evaluation, contain unique `(subject_id, prediction_time)` keys,
|
|
170
|
+
and exactly cover the requested evaluation index. Tests compare the actual key sets; self-reported manifest
|
|
171
|
+
counts are not accepted as evidence. Row order is never an association mechanism.
|
|
172
|
+
|
|
173
|
+
## Measurements
|
|
174
|
+
|
|
175
|
+
Every command manifest records monotonic wall time and sampled live process-tree memory. On Linux, peak
|
|
176
|
+
PSS from `/proc/*/smaps_rollup` is the primary comparison metric; aggregate RSS is retained as a
|
|
177
|
+
diagnostic. The measurement method and sampling interval are explicit. GPU measurements and SLURM
|
|
178
|
+
`MaxRSS`, when available, are separate metrics. Missing measurements are `null`; observed zero is `0`.
|
|
179
|
+
Time and memory are evidence, not portable test thresholds.
|
|
180
|
+
|
|
181
|
+
## Cluster execution and GitHub communication
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
$EDITOR slurm/config.sh
|
|
185
|
+
PROFILE=supervised ./slurm/submit.sh --dry-run
|
|
186
|
+
PROFILE=supervised ./slurm/submit.sh
|
|
187
|
+
scripts/github-sync.sh <run-id>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
SLURM follows the selected algorithm profile and chains stages by successful dependencies. Structured evidence belongs
|
|
191
|
+
under `runs/<run-id>/`; raw logs, datasets, checkpoints, and credentials do not. GitHub synchronization
|
|
192
|
+
pushes a `runs/eic_ar/<run-id>` branch and optionally opens a draft PR. A failed push leaves the
|
|
193
|
+
result committed and recoverable locally.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
eic_ar/__init__.py,sha256=caVnt4MiV246ZeLn02GeWDnjNdXJxrcXFmflBME0yoo,114
|
|
2
|
+
eic_ar/__main__.py,sha256=1jnj4N-XQVvKRcEUzvuPTYGU5UhldT0cdwjzVMmOomQ,3939
|
|
3
|
+
eic_ar/classifier.py,sha256=G2pdeotbH4BItMpj3YLzrYpwSClWcGwiy3kykgM6PJM,3211
|
|
4
|
+
eic_ar/config.py,sha256=ZXXEWcWXWtmNvxBM4n734ULM_77L1fPNhce-us9r7wI,4988
|
|
5
|
+
eic_ar/eic_ar.py,sha256=BXAijuN8Dd6VmTgpsBqf_qbF8Nii0O8GoxC5QOyUNtE,36747
|
|
6
|
+
eic_ar/presets/demo_False.yaml,sha256=8cvGmIWHOUpFwTZAoeCl5nH58K5tQPjs4AdsqC3iifM,71
|
|
7
|
+
eic_ar/presets/demo_True.yaml,sha256=25ry8xOtvPbXNaVNanhLhYJ5ZCqNiwZZ1fdi-x424zM,539
|
|
8
|
+
eic_ar/resources/algorithms/finetune/model.yaml,sha256=F43cS_u2r3YEUbHlVvbiThoCckBt5O5F8xGsqNDCUng,2153
|
|
9
|
+
eic_ar/resources/algorithms/probe/model.yaml,sha256=GiSnQFm2wSdNrhOLSxEisWWeCNlGoUwExBwQDj0xh6E,2400
|
|
10
|
+
eic_ar/resources/algorithms/supervised/model.yaml,sha256=ZAoZJ_ULbg5LVtocxwir80jcrqojZAG12oxUtFkHuJ4,1879
|
|
11
|
+
eic_ar/resources/algorithms/zero_shot_materialized/model.yaml,sha256=4cIoDHxj32VrTGxWs4dFYIjnckbW5bferzllPBcSQx8,2496
|
|
12
|
+
eic_ar/resources/runs/run.yaml,sha256=EuP7xhUEaEZpXoOkxWNoOKhtEyvrxRYoQwZqBhZnenA,1153
|
|
13
|
+
meds_algorithm_eic_ar-0.1.0.dist-info/METADATA,sha256=xscBmhp3GXOVdDtBDwx1Ff_5bTHrv1EurK3jfEgOFD8,10212
|
|
14
|
+
meds_algorithm_eic_ar-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
15
|
+
meds_algorithm_eic_ar-0.1.0.dist-info/entry_points.txt,sha256=XA7FujnKu-b_EhjMY4JHkuqVbj5aAt-m5HKcEwn8eHY,48
|
|
16
|
+
meds_algorithm_eic_ar-0.1.0.dist-info/licenses/LICENSE,sha256=4322LZHfsIxDpUX7mlNFybWR8UZ3aVTUC9ffPbwHb9Y,1092
|
|
17
|
+
meds_algorithm_eic_ar-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Florent Pollet
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|