Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/api/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,11 @@ PyHealth does not ship any data: you download each dataset from its source and p
- `PhysioNet <https://physionet.org/content/challenge-2012/1.0.0/>`__
- Yes
- —
* - :doc:`PhysioNet/CinC 2019 (Sepsis) <datasets/pyhealth.datasets.PhysioNet2019Dataset>`
- Open
- `PhysioNet <https://physionet.org/content/challenge-2019/1.0.0/>`__
- Yes
- —
* - :doc:`MIT-BIH Arrhythmia <datasets/pyhealth.datasets.MITBIHDataset>`
- Open
- `PhysioNet <https://physionet.org/content/mitdb/1.0.0/>`__
Expand Down Expand Up @@ -717,6 +722,7 @@ Available Datasets
MIT-BIH Arrhythmia Dataset <datasets/pyhealth.datasets.MITBIHDataset>
PTB-XL Dataset <datasets/pyhealth.datasets.PTBXLDataset>
PhysioNet 2012 Dataset <datasets/pyhealth.datasets.PhysioNet2012Dataset>
PhysioNet 2019 Dataset <datasets/pyhealth.datasets.PhysioNet2019Dataset>
datasets/pyhealth.datasets.TUABDataset
datasets/pyhealth.datasets.TUEVDataset
datasets/pyhealth.datasets.CHBMITDataset
Expand Down
42 changes: 42 additions & 0 deletions docs/api/datasets/pyhealth.datasets.PhysioNet2019Dataset.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
pyhealth.datasets.PhysioNet2019Dataset
======================================

Overview
--------

The PhysioNet/Computing in Cardiology Challenge 2019 dataset contains 40,336
ICU stays collected across two hospitals (Hospital A: 20,336; Hospital B:
20,000), totaling 1,552,210 hourly records (7.3% septic patients, 1.8%
positive hours). Each record is a pipe-separated wide table with 8 vital signs,
26 intermittently sampled laboratory tests, 5 static admission descriptors,
elapsed ICU hour (``ICULOS``), and hourly ``SepsisLabel`` (set to 1 starting
6 hours before clinical onset). The dataset is open access (CC BY 4.0), so
``PhysioNet2019Dataset(root, download=True)`` fetches it without credentials.

For more information see `PhysioNet Challenge 2019
<https://physionet.org/content/challenge-2019/1.0.0/>`_ and Reyna et al.,
Critical Care Medicine 2020.

The dataset streams the raw ``.psv`` stay files once into three tables written
into ``root``:

- ``events``: non-NaN hourly vital-sign and laboratory observations only
(preserving informative missingness / MNAR without forced imputation).
- ``labels``: one row per patient-hour with ``sepsis_label``, preserving hours
where all dynamic variables are NaN.
- ``patients``: one row per stay holding ``hospital`` (``"A"`` or ``"B"``),
static descriptors, ``num_hours``, ``sepsis``, and ``first_sepsis_hour``.

API Reference
-------------

.. autoclass:: pyhealth.datasets.PhysioNet2019Dataset
:members:
:undoc-members:
:show-inheritance:

.. autofunction:: pyhealth.datasets.physionet2019.download_physionet2019

.. autofunction:: pyhealth.datasets.physionet2019.prepare_physionet2019

.. autofunction:: pyhealth.datasets.physionet2019.parse_wide_hourly_record
1 change: 1 addition & 0 deletions pyhealth/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def __init__(self, *args, **kwargs):
from .covid_blues import COVIDBLUESDataset as COVIDBLUESDataset
from .chapman_shaoxing import ChapmanShaoxingDataset as ChapmanShaoxingDataset
from .physionet2012 import PhysioNet2012Dataset as PhysioNet2012Dataset
from .physionet2019 import PhysioNet2019Dataset as PhysioNet2019Dataset
from .pmdata import PMDataDataset as PMDataDataset
from .dreamt import DREAMTDataset
from .ehrshot import EHRShotDataset
Expand Down
37 changes: 37 additions & 0 deletions pyhealth/datasets/configs/physionet2019.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: "1.0.0" # PhysioNet/CinC Challenge 2019, open access (CC BY 4.0)
tables:
events:
# Non-NaN hourly vital-sign and laboratory observations only.
file_path: "physionet2019-pyhealth-events.csv"
patient_id: "patient_id"
# TIME_ORIGIN plus elapsed ICU hours (ICULOS)
timestamp: "time"
timestamp_format: "%Y-%m-%d %H:%M:%S"
attributes:
- "hour"
- "parameter"
- "value"
labels:
# One row per patient-hour; preserves hours where all dynamic vars are NaN.
file_path: "physionet2019-pyhealth-labels.csv"
patient_id: "patient_id"
timestamp: "time"
timestamp_format: "%Y-%m-%d %H:%M:%S"
attributes:
- "hour"
- "sepsis_label"
patients:
# One row per ICU stay with static descriptors, hospital ID, and outcomes.
file_path: "physionet2019-pyhealth-patients.csv"
patient_id: "patient_id"
timestamp: null
attributes:
- "hospital"
- "age"
- "gender"
- "unit1"
- "unit2"
- "hosp_adm_time"
- "num_hours"
- "sepsis"
- "first_sepsis_hour"
Loading
Loading