** DEPLOYED LINK: https://heart-byte.vercel.app **
Heart failure is a prevalent and serious medical condition that often leads to hospital readmissions, which pose risks to patient health and contribute to significant healthcare costs. This project aims to predict the likelihood of heart failure patients being readmitted to the hospital within 30 days after discharge using machine learning models. Early identification of patients at risk of readmission can help healthcare providers allocate resources more effectively and offer timely interventions.
The dataset used for this project is from the MIMIC-III database, which includes information about heart failure patients, their hospital admissions, diagnoses, and more. Specifically, the dataset contains:
- ADMISSIONS: Details about each hospital admission, such as discharge time.
- PATIENTS: Patient demographic data, including age and gender.
- DIAGNOSES_ICD: Diagnosis codes (ICD-9) for each patient, used to filter heart failure diagnoses.
ICD-9 Codes for Heart Failure:
'39891', '40201', '40211', ... , '4289'
The goal is to predict whether a patient will be readmitted within 30 days after discharge. This can help healthcare providers take proactive measures to reduce readmissions, ultimately improving patient outcomes and reducing the financial burden on hospitals.
- backend/: Contains the Python-based ML model, data processing, and results evaluation scripts.
- frontend/: Contains the ReactJS frontend to interact with the backend for prediction results.
To run this project, you'll need the following Python libraries:
- pandas
- numpy
- matplotlib
- seaborn
- scikit-learn
- flask
Install the dependencies by running:
pip install -r requirements.txtAlong with accurate predictions, we made sure to create user-friendly website with secure user authentication.
Figma Link: https://www.figma.com/design/srSKD2Pv2H9etMUhTxjQo8/Heartbyte?node-id=0-1&t=MDm4zEBP9bXFPA8u-1
Please for more details refer : https://github.com/SakshamTyagii/heartbyte
- Total Patients: 10,272
- Total Admissions: 16,756
- Average Admissions per Patient: 1.63
- 30-day Readmission Rate: 9.75%
- Readmissions within 30 days: 1,634
Located in src/data_processing.py, this pipeline performs:
- β Table merging: patients, admissions, diagnoses, procedures
- β Missing value imputation (mean for numerical, mode for categorical)
- β One-hot encoding for categorical features
- β Feature normalization (StandardScaler)
- β Readmission target creation (30-day window)
- β Stratified train/test splitting
Top ICD-9 codes associated with high readmission rates:
- 42843 β 12.84%
- 42841 β 10.96%
- 42833 β 10.82%
- Longer hospital stay increases readmission risk
- Previous admissions strongly correlate with future readmissions
- Multiple diagnoses lead to higher readmission probability
Three models were trained and evaluated:
- Logistic Regression (Baseline, final model)
- Random Forest (Ensemble, better generalization)
- XGBoost (Best performing, high complexity)
- Precision, Recall, F1-Score
- ROC-AUC
- Confusion Matrix
- Feature Importance Rankings
Used SHAP (SHapley Additive exPlanations) for interpretability:
- SHAP Summary Plot β Overall feature impact
- Dependence Plot β How a feature affects predictions
- Waterfall Plot β Step-by-step explanation of a prediction
- Force Plot β Visualizes contributions per feature
This part of the project provides personalized diet recommendations using the Groq LLM API. The system uses a Flask backend to interact with Groq's powerful language models for generating customized meal plans. The project also includes a Node.js backend and components for machine learning models .
https://docs.google.com/document/d/1v5DqrDbMslF0bF4KlzYulq0jqkfomoN9_nI8mE18rhs/edit?usp=sharing
https://drive.google.com/file/d/13GFURuUzPL4jqGMBaUWtf_b2dhaU1FM3/view?usp=drivesdk






