BMJ Open. 2026 Aug 31;16(8):e106407. doi: 10.1136/bmjopen-2025-106407.
ABSTRACT
BACKGROUND: Diabetes has reached epidemic proportions in Pakistan. This study applied machine learning (ML) techniques to identify comorbidity-based and diabetic complications-based clusters in hospitalised patients with diabetes and examine their association with in-hospital mortality.
DESIGN: Retrospective cross-sectional study.
SETTING: Aga Khan University Hospital, Pakistan.
PARTICIPANTS: Adult patients (≥18 years) with diabetes admitted between 2008 and 2021.
METHODS: Diagnoses were extracted using International Classification of Diseases (ICD-9 and ICD-10) codes. Data was integrated from the Hospital Information Management Systems (HIMS). The K-Modes clustering algorithm was applied to categorical diagnostic data, with the optimal number of clusters determined using elbow curve and silhouette score analysis. Latent-Dirichlet Allocation and Term Frequency-Inverse Document Frequency were applied to identify frequent terms from each cluster followed by expert validation. Logistic regression was performed to assess the association between cluster membership and in-hospital mortality.
RESULTS: Among 78 271 patients, four clusters were identified with varying mortality risks: (1) cardio, tumour and tobacco (CTT), (2) renal complication cluster (RCC), (3) cardiovascular cluster (CVC) and (4) uncontrolled diabetes mellitus, hypertension, stroke and kidney (HSK). The within cluster mortality was highest in the RCC cluster (682; 18.1%), followed by CVC (543; 4.4%), HSK (1,379; 4%) and CTT (603; 2.2%). Compared with CTT, the unadjusted odds of in-hospital mortality were significantly higher in RCC (OR=9.9, 95% CI 8.9 to 11.2, p<0.001), CVC (OR=2.1, 95% CI 1.9 to 2.3, p<0.001) and HSK (OR=1.9, 95% CI 1.7 to 2.1, p<0.001).
CONCLUSION: Among hospitalised patients with diabetes, the RCC cluster demonstrated the highest mortality risk, comprising predominantly older patients with severe complications. These findings highlight the utility of unsupervised ML approaches for identifying high-risk clinical phenotypes and informing risk stratification in resource-constrained settings. Longitudinal studies are warranted to evaluate progression and long-term outcomes across clusters.
PMID:42674787 | DOI:10.1136/bmjopen-2025-106407

