ATLAS-EHR
ATLAS-EHR is a PyTorch representation model for longitudinal structured EHR events. It returns per-timestamp z_set and z_context representations; it is research software, not a clinical device.
Release version: 0.2.0. The public runtime uses only JSON and safetensors—never Lightning checkpoints or research code.
Installation
Clone the intended Hugging Face repository and install its packaged runtime:
git clone https://huggingface.co/sunx999/ATLAS-EHR
cd ATLAS-EHR
python -m pip install .
This installs the declared PyTorch, NumPy, pandas, PyArrow, safetensors, and Hugging Face Hub dependencies. ATLAS-EHR is not published on PyPI; Lightning and the research src/ package are not required. After installation, load the model from the local checkout or with the Hub API below.
Input requirement
Users must supply already-prepared model-space events: ATLAS variable ID (VID), prepared value, and admission-relative time in minutes. The released schema is required. ATLAS-EHR does not extract raw EHR data, harmonize concepts, convert units, normalize values, or map local schemas.
Representation inference
from atlas_ehr import ATLASModel, AtlasCollator, PreparedSample
model = ATLASModel.from_pretrained_local("pretrained_backbone").eval()
sample = PreparedSample("example", [1, 2], [0.2, 1.0], [0.0, 30.0])
batch = AtlasCollator.from_pretrained_config("pretrained_backbone")([sample])
output = model(**batch)
For prepared Parquet data, use AtlasParquetDataset with a normal PyTorch DataLoader and AtlasCollator. model.encode(**batch) is an inference convenience method; model(**batch) remains differentiable. Freeze or unfreeze the backbone and attach a user-defined head for custom downstream work.
Formal task variants
Task artifacts are explicit variants under task_artifacts/variants/<task>/<source_name>. The checked-in release registry supplies one recommended release variant per task; the other source remains an available alternative. source_name (z_set or z_context) is artifact-defined and never selected from runtime metrics.
| Task | Recommended variant |
|---|---|
| mortality | z_set |
| LOS ≥3d | z_set |
| LOS ≥7d | z_context |
| readmission | z_set |
| ICD | z_context |
| HCUP | z_context |
| DRG | z_set |
For LOS ≥7d, z_context is the recommended MIMIC/formal-release variant; z_set remains available as an alternative.
from atlas_ehr import ATLASForPrediction
predictor = ATLASForPrediction.from_pretrained_local(
"pretrained_backbone", task="mortality"
)
result = predictor.predict_samples([sample])
To request an available alternative explicitly, use task="mortality", source_name="z_context"; direct task_variant="task_artifacts/variants/mortality/z_context" loading remains supported.
Visibility is fixed by task: mortality first 48 h; los_ge_3d and los_ge_7d first 24 h; readmission, ICD, HCUP, and DRG full visible admission. Cutoffs are applied before contextual representation computation. ICD/HCUP use exported validation-fitted thresholds; DRG uses its competitive cardinality decoder.
Hugging Face Hub
model = ATLASModel.from_pretrained("owner/ATLAS-EHR", revision="v0.2.0")
predictor = ATLASForPrediction.from_pretrained(
"owner/ATLAS-EHR", task="mortality", revision="v0.2.0"
)
Hub loading downloads declared files from one pinned revision and applies the same local schema, safetensors, and provenance validation.
Limitations
The pretrained model requires released-schema semantics and should not be assumed to transfer unchanged to arbitrary hospitals or raw EHR systems. Formal task variants are frozen-probe artifacts, not jointly fine-tuned clinical deployment models.