This is a re-implementation of the GRU-D
model with Python3 + Keras2 + Tensorflow
.
Zhengping Che, Sanjay Purushotham, Kyunghyun Cho, David Sontag, and Yan Liu. "Recurrent Neural Networks for Multivariate Time Series with Missing Values", Scientific Reports (SREP), 8(1):6085, 2018.
An earlier version is available on arXiv (arXiv preprint arXiv:1606.01865).
Python3.6
requirements.txt
Python3
packages
[WD]
to represent the working directory
(i.e., working path, in which all related data/log/model/result/evaluation files are stored).[WD]/data/${dataset_name}
.
Please see data_handler.py
for more information.
[WD]/data/${dataset_name}/data.npz
, there are input
, masking
, timestamp
, label_${label_name}
.
Each of them is of the shape (n_samples, ...)
[WD]/data/${dataset_name}/fold.npz
, there are fold_${label_name}
, mean_${label_name}
, std_${label_name}
.
Each of them is of the shape (k_fold, 3, ...)
, for train/validation/test sets in k-fold cross validation.(x, masking, timestamp)
as the inputs.
Please refer to models.py
and nn_utils/grud_layers.py
.Run.ipynb
serves as an example script for model training and evaluation.[WD]/data/sample
.
The sample data is generated by Generate-sample-data.ipynb
.The following steps will help you to conduct experiments for mortality predictions on the MIMIC-III dataset with the time series within the first 48 hours after the patient's admission. We rely on this (older version of) Benchmarking codebase to extract and preprocess the time series data from the MIMIC-III dataset and provide necessary scripts to convert the data for our GRU-D models.
[#]_***.ipynb
for 0 <= [#] <= 9
8_processing.ipynb
) may take hours or a couple of days to complete.run_necessary_sqls.ipynb
10_get_17-features-processed.ipynb
10_get_99plus-features-raw.ipynb
11_get_time_series_sample_99plus-features-raw_48hrs.ipynb
Prepare-MIMIC-III-data.ipynb
and execute it to prepare the data for GRU-D.Run.ipynb
and check the results!