End-to-end predictive modeling on EHR data for in-hospital mortality and length-of-stay. Implements traditional ML, LSTM, Transformers, and clinical LLMs (BioClinicalBERT, Internist-7B), with feature engineering, fairness analysis, and model comparison on MIMIC-inspired datasets.
Jupyter Notebook
0
6 commits
updated Apr 27, 2026
This repository presents a comprehensive end-to-end pipeline for predicting in-hospital mortality and length of hospital stay (LOS) using Electronic Health Record (EHR) data.
The project systematically compares:
The dataset is a synthetic EHR dataset inspired by MIMIC-III/IV, consisting of 5,000 patients across multiple relational tables.
├── data/
│ ├── patients_table.csv
│ ├── patient_admissions.csv
│ └── disease_diagnosis_code.csv
│
├── Notebooks/
│ ├── Preprocessing/
│ │ └── EHR_featureEngineering.ipynb
│ │
│ ├── Traditional_ML/
│ │ └── EHR_modelDevelopment.ipynb
│ │
│ ├── LSTM_Transformer/
│ │ └── LSTM_transformer.ipynb
│ │
│ └── LLM/
│ ├── llm_internist_7b.ipynb
│ └── LLM_Bio_ClinicalBERT_Modified.ipynb
│
├── scripts/
│ ├── ehr_featureengineering.py
│ └── ehr_modeldevelopment.py
│ └── llm_internist_7b.py
│ └── llm_bio_clinicalbert_modified.py
│
└── README.md
The dataset consists of three relational tables:
hospital_expire_flagThe project follows a structured pipeline from raw EHR data to advanced predictive modeling:
Notebook: Notebooks/Preprocessing/EHR_featureEngineering.ipynb
Script: Scripts/EHR_featureEngineering.py
subject_id and hadm_idTemporal Features
Demographic Features
Diagnosis-Based Features
Categorical Encoding
Notebook: Notebooks/Traditional_ML/EHR_modelDevelopment.ipynb
Script: Scripts/EHR_modelDevelopment.py
Notebook: Notebooks/LSTM_Transformer/LSTM_transformer.ipynb
Notebooks:
Notebooks/LLM/llm_internist_7b.ipynbNotebooks/LLM/LLM_Bio_ClinicalBERT_Modified.ipynbScripts:
Scripts/llm_internist_7b.py
Scripts/LLM_Bio_ClinicalBERT_Modified.py
Conversion of structured EHR data into clinical text
Models: BioClinicalBERT, Internist-7B
Fine-tuning and multitask learning (mortality + LOS).
git clone https://github.com/your-username/repo-name.git
cd repo-name
pip install -r requirements.txt
EHR_featureEngineering.ipynbEHR_modelDevelopment.ipynbLSTM_Transformer.ipynbllm_internist_7b.ipynb, LLM_Bio_ClinicalBERT_Modified.ipynbEHR_featureEngineering.pyEHR_modelDevelopment.pyllm_internist_7b.py, LLM_Bio_ClinicalBERT_Modified.pyThis project uses a synthetic dataset inspired by clinical data (MIMIC-III/IV).
It is intended for research and educational purposes only and should not be used for real clinical decision-making.
This project is for academic and research purposes only.
End-to-end predictive modeling on EHR data for in-hospital mortality and length-of-stay. Implements traditional ML, LSTM, Transformers, and clinical LLMs (BioClinicalBERT, Internist-7B), with feature engineering, fairness analysis, and model comparison on MIMIC-inspired datasets.
Jupyter Notebook
0
6 commits
updated Apr 27, 2026
This repository presents a comprehensive end-to-end pipeline for predicting in-hospital mortality and length of hospital stay (LOS) using Electronic Health Record (EHR) data.
The project systematically compares:
The dataset is a synthetic EHR dataset inspired by MIMIC-III/IV, consisting of 5,000 patients across multiple relational tables.
├── data/
│ ├── patients_table.csv
│ ├── patient_admissions.csv
│ └── disease_diagnosis_code.csv
│
├── Notebooks/
│ ├── Preprocessing/
│ │ └── EHR_featureEngineering.ipynb
│ │
│ ├── Traditional_ML/
│ │ └── EHR_modelDevelopment.ipynb
│ │
│ ├── LSTM_Transformer/
│ │ └── LSTM_transformer.ipynb
│ │
│ └── LLM/
│ ├── llm_internist_7b.ipynb
│ └── LLM_Bio_ClinicalBERT_Modified.ipynb
│
├── scripts/
│ ├── ehr_featureengineering.py
│ └── ehr_modeldevelopment.py
│ └── llm_internist_7b.py
│ └── llm_bio_clinicalbert_modified.py
│
└── README.md
The dataset consists of three relational tables:
hospital_expire_flagThe project follows a structured pipeline from raw EHR data to advanced predictive modeling:
Notebook: Notebooks/Preprocessing/EHR_featureEngineering.ipynb
Script: Scripts/EHR_featureEngineering.py
subject_id and hadm_idTemporal Features
Demographic Features
Diagnosis-Based Features
Categorical Encoding
Notebook: Notebooks/Traditional_ML/EHR_modelDevelopment.ipynb
Script: Scripts/EHR_modelDevelopment.py
Notebook: Notebooks/LSTM_Transformer/LSTM_transformer.ipynb
Notebooks:
Notebooks/LLM/llm_internist_7b.ipynbNotebooks/LLM/LLM_Bio_ClinicalBERT_Modified.ipynbScripts:
Scripts/llm_internist_7b.py
Scripts/LLM_Bio_ClinicalBERT_Modified.py
Conversion of structured EHR data into clinical text
Models: BioClinicalBERT, Internist-7B
Fine-tuning and multitask learning (mortality + LOS).
git clone https://github.com/your-username/repo-name.git
cd repo-name
pip install -r requirements.txt
EHR_featureEngineering.ipynbEHR_modelDevelopment.ipynbLSTM_Transformer.ipynbllm_internist_7b.ipynb, LLM_Bio_ClinicalBERT_Modified.ipynbEHR_featureEngineering.pyEHR_modelDevelopment.pyllm_internist_7b.py, LLM_Bio_ClinicalBERT_Modified.pyThis project uses a synthetic dataset inspired by clinical data (MIMIC-III/IV).
It is intended for research and educational purposes only and should not be used for real clinical decision-making.
This project is for academic and research purposes only.