What can encounter data reveal about readmission patterns and model behavior?
01 / Problem & data
How can a model comparison show what was evaluated without presenting exploratory scores as clinical readiness?
Historical hospital encounters involving diabetes, with readmission within 30 days as the target. Encounters and unique patients are different units and should not share one count label.
Explore subgroups and compare two models using a split grouped by patient.
02 / Implementation
Follow the data through the product.
Encounter exploration
The project examines historical encounters involving diabetes for educational analysis.
Feature preparation
Preparation brings encounter attributes into a form that can be explored and compared.
Patient-grouped split
Grouping the validation split by patient keeps the same patient from appearing on both sides.
Logistic regression + XGBoost
Logistic regression and XGBoost provide two inspectable modeling approaches.
Validation + charts
The interface presents exploratory comparisons, not a clinically validated prediction service.
Three implementation choices
Split by patient, not by encounter.
GroupShuffleSplit separates training and validation by patient identifier. This reduces leakage from encounters belonging to the same person appearing on both sides of the split.
Compare discrimination and precision.
The application exposes ROC-AUC and average precision for logistic regression and XGBoost. A modest difference between models should not be presented as a large product outcome.
Separate description from causation.
Age, medication, admission, and length-of-stay charts describe the dataset. They do not establish why a patient returns or validate the application’s probability thresholds.
03 / Evidence & reflection
What the work demonstrates.
The implementation brings subgroup exploration, model comparison, and a prediction form into one workflow. Earlier reported scores have not been reproduced for this portfolio update, so they are not used as headline metrics.
Reproduce the evaluation, check calibration and subgroup performance, and correct encounter-versus-patient labels before extending the analysis. This is educational work; the source repository remains private.
