โ† All projects

Hospital Readmission Risk

Which patients are most likely to return within 30 days, and what drives it?

Simulated dataHealthcarePythonscikit-learnSciPySeaborn
5,000patient records
0.97ROC AUC
30%importance of total prior visits

The question

Thirty-day readmissions are a quality measure and a cost driver for hospitals. The aim was to find which patient factors matter and whether a model could flag high-risk patients early.

What I did

Cleaned and encoded 5,000 simulated diabetic patient records.
Ran chi-square tests and t-tests to see which factors relate to readmission.
Engineered total visits, procedures per day, medications per day and a high-risk flag.
Trained logistic regression and random forest models and compared them with confusion matrices and ROC curves.

What I found

Prior inpatient visits (r = 0.44) and emergency visits (r = 0.38) had the strongest link to readmission.
Readmitted patients stayed 7.8 days on average, against 5.6 for the others.
Admission type was significantly associated with readmission (chi-square 152.8, p below 0.001). Gender, race, A1C result and insulin were not.
Random forest reached 92% accuracy and a ROC AUC of 0.97. Total prior visits was the top feature.

Charts from the analysis

Readmission status in the dataset.
Readmission status in the dataset.
ROC curves for both models.
ROC curves for both models.
Random forest feature importance.
Random forest feature importance.

Limits to keep in mind

Simulated data

The data is simulated and 83.8% of patients are readmitted, far above real hospital rates. A model that always predicts readmission would already score 83.8%, so 92% is a modest gain. This project shows the workflow and not clinical performance.

View the code on GitHub โ†—
โ† PreviousCOVID-19 ICU Occupancy and the Case-to-ICU LagNext โ†’COVID-19 Waves and Vaccination