ehrdata.dt.eicu_crd

Contents

ehrdata.dt.eicu_crd#

ehrdata.dt.eicu_crd(data_path=None, *, interval_length_number=1, interval_length_unit='h', num_intervals=48, aggregation_strategy='last', layer=None)#

Loads the demo of the eICU Collaborative Research Database (v2.0.1).

The eICU Collaborative Research Database holds the data of patients admitted to intensive care units (ICUs) across the United States in 2014 and 2015 [PJR+18] [GAG+00]. Its openly available demo holds 2520 ICU stays from 20 hospitals. The observations are the ICU stays, identified by patientunitstayid, with the stay and patient information of the patient table in obs. The variables are the vital signs of the vitalPeriodic and vitalAperiodic tables and the laboratory measurements of the lab table, with the time since ICU admission. Measurements before the ICU admission are not included.

Ages above 89 years, which are "> 89" in the original dataset, are 90. hospital_death and unit_death are 1 if the patient died in the hospital or in the ICU, respectively, and 0 otherwise, instead of the hospitaldischargestatus and unitdischargestatus with "Expired" and "Alive". tem['time_value'] is the start of every interval in interval_length_unit, for instance hours since ICU admission with the defaults.

Parameters:
data_path Path | str | None (default: None)

Path to the raw data. If the path exists, the data is loaded from there. Else, the data is downloaded.

interval_length_number int (default: 1)

Numeric value of the length of one interval.

interval_length_unit str (default: 'h')

Unit belonging to the interval length.

num_intervals int (default: 48)

Number of intervals.

aggregation_strategy Literal['last', 'first', 'mean', 'median', 'min', 'max'] (default: 'last')

Aggregation strategy for the values of a variable within one interval, as in from_events().

layer str | None (default: None)

Name of the layer in the EHRData object that will store the time series data. If not specified, it uses X.

Return type:

EHRData

Returns:

The eICU demo dataset of shape ICU stays × variables × intervals. The raw data is also downloaded, stored and available under the data_path.

Examples

>>> import ehrdata as ed
>>> edata = ed.dt.eicu_crd()
>>> edata.shape
(2520, 170, 48)
>>> edata.obs[["gender", "age", "unittype", "hospital_death"]].head(3)
                   gender   age      unittype  hospital_death
patientunitstayid
141764             Female  87.0  Med-Surg ICU             0.0
141765             Female  87.0  Med-Surg ICU             0.0
143870               Male  76.0          SICU             0.0