This repo provides a sample code to experiment with the hART model. The notebook is best run on Google Colab. This repo was made for our study: "hART: Deep Learning-Informed Lifespan Heart Failure Risk Trajectories"
The notebook titled 'hART.ipynb' is divided into sections to ease the interpretability and usage. Here's a short description of each section:
-
Imports: a) Contains all Imports needed to run the notebook b) Upload the data needed to run the notebook, Note: Synthetic data is provided in the GitHub repo ('synthetic.csv') c) Apply the specific exclusion criteria for our study
-
Preprocessing: a) Contains helper functions to turn event-based data into sequential input and HF labels b) Data split
-
Attention Helper Functions: a) Custom function used in the Models
-
MODELS: a) Contains the novel hART model and previously developed DHTM model (https://github.com/li-lab-mcgill/recurrent-disease-progression-networks) b) Allows you to train and evaluate the performance of the models
-
Patient Population Trajectory Sample: a) Provides the ability to experiment with the hART-predicted trajectory at a population level b) Choose a subgroup to test (severe CHD vs. Non Severe CHD) c) Output is HF Trajectory + Attention Matrix (Heatmap) + Actual Distribution of HF for population
-
Individualized Trajectory Sample: a) Provides the ability to experiment with the hART-predicted trajectory at an individualized level b) Choose a baseline to test (non-severe CHD patients) and a specific individual (patient = ) c) Output is HF Trajectory + Patient's Medical Event History + Attention Matrix (Heatmap)
NOTES:
- The synthetic is NOT the real data used in the study. It is a representation of the actual data
- Use the 'sample' data frame to help run the code faster (the whole data takes hours to preprocess)
- The synthetic data is in a zip file due to size (please unzip to use)