Machine learning consensus clustering approach for hospitalized patients with dysmagnesemia

Charat Thongprayoon, Janina Paula T. Sy-Go, Voravech Nissaisorakarn, Carissa Y. Dumancas, Mira T. Keddis, Andrea G. Kattah, Pattharawin Pattharanitima, Saraschandra Vallabhajosyula, Michael A. Mao, Fawad Qureshi, Vesna D. Garovic, John J. Dillon, Stephen B. Erickson, Wisit Cheungpasitporn

Research output: Contribution to journalArticlepeer-review


Background: The objectives of this study were to classify patients with serum magnesium derangement on hospital admission into clusters using unsupervised machine learning approach and to evaluate the mortality risks among these distinct clusters. Methods: Consensus cluster analysis was performed based on demographic information, principal diagnoses, comorbidities, and laboratory data in hypomagnesemia (serum magnesium ≤ 1.6 mg/dL) and hypermagnesemia cohorts (serum magnesium ≥ 2.4 mg/dL). Each cluster’s key features were determined using the standardized mean difference. The associations of the clusters with hospital mortality and one-year mortality were assessed. Results: In hypomagnesemia cohort (n = 13,320), consensus cluster analysis identified three clusters. Cluster 1 patients had the highest comorbidity burden and lowest serum magnesium. Cluster 2 patients had the youngest age, lowest comorbidity burden, and highest kidney function. Cluster 3 patients had the oldest age and lowest kidney function. Cluster 1 and cluster 3 were associated with higher hospital and one-year mortality compared to cluster 2. In hypermagnesemia cohort (n = 4671), the analysis identified two clusters. Compared to cluster 1, the key features of cluster 2 included older age, higher comorbidity burden, more hospital admissions primarily due to kidney disease, more acute kidney injury, and lower kidney function. Compared to cluster 1, cluster 2 was associated with higher hospital mortality and one-year mortality. Conclusion: Our cluster analysis identified clinically distinct phenotypes with differing mortality risks in hospitalized patients with dysmagnesemia. Future studies are required to assess the application of this ML consensus clustering approach to care for hospitalized patients with dysmagnesemia.

Original languageEnglish (US)
Article number2119
Issue number11
StatePublished - Nov 2021


  • Artificial intelligence
  • Clustering
  • Consensus clustering
  • Dysmagnesemia
  • Electrolytes
  • Hypermagnesemia
  • Hypomagnesemia
  • Individualized medicine
  • Machine learning
  • Magnesium
  • Mortality
  • Nephrology
  • Personalized medicine
  • Precision medicine

ASJC Scopus subject areas

  • Clinical Biochemistry


Dive into the research topics of 'Machine learning consensus clustering approach for hospitalized patients with dysmagnesemia'. Together they form a unique fingerprint.

Cite this