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
1 change: 1 addition & 0 deletions docs/api/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ Available Datasets
datasets/pyhealth.datasets.PhysioNetDeIDDataset
datasets/pyhealth.datasets.EEGBCIDataset
PTB-XL Dataset <datasets/pyhealth.datasets.PTBXLDataset>
PhysioNet 2012 Dataset <datasets/pyhealth.datasets.PhysioNet2012Dataset>
datasets/pyhealth.datasets.TUABDataset
datasets/pyhealth.datasets.TUEVDataset
datasets/pyhealth.datasets.ClinVarDataset
Expand Down
36 changes: 36 additions & 0 deletions docs/api/datasets/pyhealth.datasets.PhysioNet2012Dataset.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
pyhealth.datasets.PhysioNet2012Dataset
======================================

Overview
--------

The PhysioNet/Computing in Cardiology Challenge 2012 dataset holds 12,000 ICU
stays of at least 48 hours (sets a, b and c). Each record has up to 37
irregularly sampled vital-sign and lab time series from the first 48 hours,
six descriptors recorded on admission, and outcomes (SAPS-I, SOFA, length of
stay, survival and in-hospital death). It is open access, so
``PhysioNet2012Dataset(root, download=True)`` fetches it (about 20 MB).

For more information see `PhysioNet Challenge 2012
<https://physionet.org/content/challenge-2012/1.0.0/>`_ and Silva et al.,
Computing in Cardiology 2012.

The dataset builds two tables from the raw record files and writes them into
``root``: ``events`` (one row per observation, with ``parameter``, ``value``
and ``minutes`` since ICU admission) and ``patients`` (descriptors and
outcomes). Use it with :class:`~pyhealth.tasks.PhysioNet2012Forecasting` for
irregular time-series forecasting.

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

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

.. autofunction:: pyhealth.datasets.physionet2012.download_physionet2012

.. autofunction:: pyhealth.datasets.physionet2012.prepare_physionet2012

.. autofunction:: pyhealth.datasets.physionet2012.read_record
1 change: 1 addition & 0 deletions docs/api/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,5 @@ API Reference
models/pyhealth.models.XGBoostModel
models/pyhealth.models.survival_mdn
models/pyhealth.models.ProtoECGNet
models/pyhealth.models.APN

28 changes: 28 additions & 0 deletions docs/api/models/pyhealth.models.APN.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
pyhealth.models.APN
===================

APN: a simple, effective baseline for irregular multivariate time-series
forecasting. Time-Aware Patch Aggregation pools each variable's irregular
observations into adaptive patches with learnable boundaries, a query module
summarizes the patches, and a shallow MLP forecasts the query times
(`Liu et al., AAAI 2026 <https://arxiv.org/abs/2505.11250>`_).

See ``examples/apn_physionet2012_forecasting.ipynb`` for a reproduction of
the paper's PhysioNet 2012 result.

.. autoclass:: pyhealth.models.APN
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: pyhealth.models.TimeAwarePatchAggregation
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: pyhealth.models.LearnableTimeEncoding
:members:
:undoc-members:
:show-inheritance:

.. autofunction:: pyhealth.models.masked_mse
1 change: 1 addition & 0 deletions docs/api/tasks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ Available Tasks
COVID-19 CXR Classification <tasks/pyhealth.tasks.COVID19CXRClassification>
COVID-19 CXR Image Generation <tasks/pyhealth.tasks.COVID19CXRImageGeneration>
PTB-XL Multilabel Classification <tasks/pyhealth.tasks.PTBXLMultilabelClassification>
PhysioNet 2012 Forecasting <tasks/pyhealth.tasks.PhysioNet2012Forecasting>
DKA Prediction (MIMIC-IV) <tasks/pyhealth.tasks.dka>
Drug Recommendation <tasks/pyhealth.tasks.drug_recommendation>
EHR Generation <tasks/pyhealth.tasks.generate_ehr>
Expand Down
17 changes: 17 additions & 0 deletions docs/api/tasks/pyhealth.tasks.PhysioNet2012Forecasting.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
pyhealth.tasks.PhysioNet2012Forecasting
=======================================

Irregular multivariate time-series forecasting on PhysioNet 2012, in the
setup of the forecasting benchmarks (GraFITi, Warpformer, APN): from the
first 36 hours of an ICU stay, forecast the values of 36 variables observed
at the next three observation times. Values are hourly means, z-scored, with
outliers beyond 5 standard deviations removed.

.. autoclass:: pyhealth.tasks.PhysioNet2012Forecasting
:members:
:undoc-members:
:show-inheritance:

.. autofunction:: pyhealth.tasks.physionet2012_statistics

.. autofunction:: pyhealth.tasks.physionet2012_benchmark_split
Loading
Loading