Eric Chen(echen40), Li-Kai Lin(likaikl2), Peng-Yuan Huang(pyh2)
The goal of this study is to predict heart failure risk in patients based on their electronic health record (EHR) data. Early identification of high-risk patients could enable timely interventions and improved outcomes. However, accurately predicting heart failure risk remains challenging, especially when EHR data is limited. This study aims to validate whether the Domain Knowledge Guided Recurrent Neural Networks (DG-RNN) model, which incorporates medical domain knowledge via a knowledge graph and utilizes various architectural components, can outperform existing risk prediction models and provide interpretable results.
Before running this notebook, ensure you have the following packages installed or follow the notebook code cell sequence running from top to bottom:
- Python 3.10
- NumPy
- Pandas
- Pytorch
- PyHealth
- Matplotlib
- Scikit-learn
The dataset used in this project is the MIMIC-III dataset.
The main notebook containing the final version of the project code is DL4H_Team_38_Final_Project.ipynb. This notebook includes the data preprocessing, model architecture, training loop, and evaluation metrics.
The recommended way to run this project is using Google Colab, which provides free access to GPUs. Here's a step-by-step guide:
-
Open the
DL4H_Team_38_Final_Project.ipynbnotebook in Google Colab by clickingbutton.
-
Make sure the runtime type is set to "GPU" for optimal performance:
- Click on the "Runtime" menu and select "Change runtime type".
- Choose "GPU" from the "Hardware accelerator" dropdown.
- Click "Save".
-
Execute the notebook cells in order by clicking on the "Runtime" menu and selecting "Run all". This will run the entire pipeline, from data loading to model evaluation.
The notebook should take approximately 45-60 minutes to run on a Tesla T4 GPU instance with 50 training epochs. If you run it on a CPU instance, expect the training to take around 8-10 times longer.
If you prefer to run the code locally, follow these steps:
-
Clone this repository to your local machine using
git clone. -
Navigate to the project directory.
-
Launch Jupyter Notebook or JupyterLab.
-
Open the
DL4H_Team_38_Final_Project.ipynbnotebook. -
Change folder paths accordingly.
-
Run the notebook cells in order.
Note that running the code locally requires a GPU for optimal performance. If you don't have access to a GPU, you can still run the code on a CPU, but training will take significantly longer.
-
C. Yin, R. Zhao, B. Qian, X. Lv and P. Zhang, "Domain Knowledge Guided Deep Learning with Electronic Health Records," 2019 IEEE International Conference on Data Mining (ICDM), Beijing, China, 2019, pp. 738-747, doi: 10.1109/ICDM.2019.00084. Repo: https://github.com/yinchangchang/DG-RNN/tree/master
-
CS598 Course Data Science Lab