← Selected work
Completed retrospective ML study

30-Day Hospital Readmission Risk Prediction

End-to-end machine learning pipeline for identifying hospital encounters involving patients with diabetes at elevated risk of readmission within 30 days.

  • Python
  • pandas
  • scikit-learn
  • XGBoost
  • CatBoost
  • SHAP
Explore results ↓Repository link pending verification
DomainHealthcare analytics
Primary metricPR-AUC
EvaluationLocked, unseen test set
01 / Key results

A recall-first operating point, evaluated once.

71.2%Recall
0.232PR-AUC
0.680ROC-AUC
10,004Unseen test encounters

799 of 1,122 actual 30-day readmissions identified on the locked test set.

The selected operating point intentionally prioritized recall and therefore produced a substantial false-positive burden.

02 / Problem + scope

Prioritizing limited follow-up resources.

Hospitals have limited resources for post-discharge follow-up. This retrospective project explores whether machine learning can help prioritize hospital encounters involving patients with diabetes that appear at elevated risk of 30-day readmission.

Role of the model: risk prioritization, not autonomous clinical decision-making.
Dataset

Diabetes 130-US Hospitals

More than 100,000 encounters across 130 U.S. hospitals from 1999–2008.

Population

Encounters involving diabetes

Results should not be generalized to all patients or hospital populations.

03 / ML workflow

From raw encounters to an untouched test.

✓ Zero patient overlap across train, validation, and test sets
  1. 01

    Raw data

    100K+ encounters

  2. 02

    Eligibility + target

    Define 30-day readmission label

  3. 03

    Patient-level split

    Zero patient overlap

  4. 04

    Feature engineering

    ICD-9 grouping · administrative mappings · semantic missing handling

  5. 05

    Model development

    Dummy · Logistic Regression · Random Forest · XGBoost · CatBoost

  6. 06

    Grouped CV + tuning

    5-fold patient-aware CV · PR-AUC optimization

  7. 07

    Threshold + selection

    Validation-based operating point · XGBoost selected

  8. 08

    Locked test evaluation

    Final untouched test assessment

  9. 09

    Explainability + errors

    TreeSHAP · TP / TN / FP / FN analysis

04 / Model development

Comparison before selection.

DummyClassifier, Logistic Regression, Random Forest, XGBoost, and CatBoost were evaluated. PR-AUC was the primary selection metric because only approximately 11% of encounters were positive.

Tuned validation performance
ModelPR-AUCRelative bar
CatBoost0.222551
Random Forest0.221958
XGBoost0.221426
Logistic Regression0.212923
Why XGBoost?

CatBoost achieved slightly higher validation PR-AUC, but XGBoost was selected because it provided comparable predictive performance, slightly better precision and fewer false-positive alerts around the selected ~70% recall operating point, with substantially lower computational cost.

05 / Final test evaluation

The false positives stay visible.

The operating threshold was locked before test evaluation and intentionally prioritized recall over precision.

Test encounters
10,004
Actual positives
1,122
PR-AUC
0.232455
ROC-AUC
0.680048
Precision
16.35%
Recall
71.21%
F1
0.265979
Flagged
48.84%

Confusion matrix

Predicted outcome →

Not flagged
Flagged
Not readmitted
4,795True negatives
4,087False positives
Readmitted
323False negatives
799True positives

↑ Actual outcome

06 / Explainability

What shaped model behavior.

TreeSHAP analysis highlighted the following grouped features. The portfolio includes the final ranked findings here; the source image will be added when a verified export is available.

  • 01Discharge disposition
  • 02Prior inpatient utilization
  • 03Primary diagnosis group
  • 04Medical specialty
  • 05Payer information
  • 06Secondary diagnosis group
  • 07Number of diagnoses
  • 08Diabetes medication status
  • 09Insulin status
  • 10Age
Interpretation boundary: SHAP explains model behavior and association, not medical causality.
07 / Error analysis

Where the classifier struggled.

Missed readmissions323 false negatives

Missed readmissions generally had weaker historical utilization signals than correctly identified readmissions, including fewer prior inpatient and emergency encounters, and were more frequently discharged home.

False alerts4,087 false positives

False-positive encounters often showed stronger risk-like patterns, including greater prior utilization, longer stays, more medications, more diagnoses, and more laboratory procedures.

08 / Real-world workflow

A flag prompts review—not a decision.

  1. Patient discharge
  2. Risk score
  3. Elevated-risk flag
  4. Care-team review
  5. Possible follow-up
Medication reviewEarlier follow-up appointmentDischarge-plan reviewCare coordination

Clinical decisions remain with healthcare professionals.

09 / Limitations

Evidence boundaries matter.

Historical data

1999–2008 encounters may not reflect modern clinical practice.

False-positive burden

Higher recall required flagging many encounters that were not readmitted.

No prospective clinical validation

The model was evaluated retrospectively and has not been validated for clinical deployment.

Population scope

Results apply to this diabetic hospital-encounter dataset and should not be generalized to all patients.

Further work should investigate subgroup disparities. Results are associative, not causal, and deployment would require prospective validation plus a clinically validated threshold.

Technical implementation

Want the technical details?

The repository contains the preprocessing pipeline, tests, tuning, SHAP analysis, and error-analysis artifacts. A verified public repository link will appear here once configured.

Back to selected work