Applied machine learning / 2025
Explainable AI for Clinical Decision Support.
From a risk score to a readable explanation
A readmission risk score is difficult to interpret without an account of the factors that influenced it. I built a research prototype that processes histories of diabetes-related hospital encounters, predicts one of three readmission categories, and presents model-attribution signals alongside retrieved clinical context.
PyTorchLSTM / GRUSHAPChromaDBLangChainFlask
Modeling patient histories
The PyTorch pipeline prepares longitudinal encounter data, handles missing and categorical features, and uses a configurable GRU or LSTM model to classify readmission as none, after 30 days or within 30 days. Training, preprocessing and inference are separated so the same transformations can be reused when inspecting predictions.
Putting explanations alongside predictions
SHAP estimates how input features contribute to a prediction. A retrieval-assisted language-model component uses medical documents and those attribution signals to draft a readable report. This adds context for inspection, but neither SHAP attribution nor generated text establishes a causal clinical explanation.
What the evaluation revealed
The checked-in evaluation reports 60.0% overall accuracy and a macro F1 of 0.396 on 15,108 examples. The confusion matrix also exposes a serious weakness: recall for one of the three classes is only about 1.6%. That imbalance matters more than the headline accuracy and rules out claiming reliable patient-level decision support.
- Three-class sequence model with saved preprocessing and inference artifacts
- Flask interface with questionnaire and CSV batch workflows
- Per-prediction attributions and retrieval-assisted reports
The engineering lesson
Building an end-to-end demonstration exposed the gap between a functioning ML pipeline and an application suitable for clinical use. In a high-stakes setting, per-class errors, explanation fidelity and external validation matter at least as much as whether the interface can produce a prediction.
Academic research prototype only. It has not been clinically validated, and its class-level performance does not support real patient-care decisions.