Predicting hyperkalemia in patients with advanced chronic kidney disease using the XGBoost model
Related Experiment Video
Updated: Jul 26, 2025

Machine Learning Algorithms for Early Detection of Bone Metastases in an Experimental Rat Model
Published on: August 16, 2020
Hsin-Hsiung Chang1,2, Jung-Hsien Chiang3, Chun-Chieh Tsai4
1Division of Nephrology, Department of Internal Medicine, Antai Medical Care Corporation Antai Tian-Sheng Memorial Hospital, Pingtung County, Taiwan.
Insights
A machine learning model accurately predicts hyperkalemia in chronic kidney disease (CKD) patients. This AI tool outperformed physicians, offering a promising approach for managing this common CKD complication.
Area of Science:
- Nephrology
- Artificial Intelligence
- Predictive Modeling
Background:
- Hyperkalemia is a frequent and serious complication in patients with chronic kidney disease (CKD).
- Elevated potassium levels in CKD are linked to increased mortality, disease progression, hospitalizations, and healthcare expenses.
- Predicting hyperkalemia is crucial for timely intervention in advanced CKD patients.
Purpose of the Study:
- To develop and evaluate a machine learning model for predicting hyperkalemia in advanced CKD patients.
- To compare the predictive performance of the machine learning model against human clinicians.
Main Methods:
- A retrospective study of 1,965 advanced CKD patients in Taiwan (2010-2020).
- Patients were divided into training (75%) and testing (25%) datasets.
- An XGBoost model was developed and compared to logistic regression and nephrologists using AUC, sensitivity, specificity, and accuracy.
Main Results:
- The XGBoost model achieved an AUC of 0.867, outperforming clinicians.
- Key predictors identified included hemoglobin, previous serum potassium, angiotensin receptor blocker use, and calcium polystyrene sulfonate use.
- The XGBoost model demonstrated superior predictive accuracy (0.933) and PPV (0.700) compared to physicians.
Conclusions:
- The XGBoost machine learning model offers superior predictive performance for hyperkalemia compared to human clinicians in an outpatient CKD setting.
- This AI-driven approach can aid in proactive management of hyperkalemia in CKD patients.
Background:
Hyperkalemia is a common complication of chronic kidney disease (CKD). Hyperkalemia is associated with mortality, CKD progression, hospitalization, and high healthcare costs in patients with CKD. We developed a machine learning model to predict hyperkalemia in patients with advanced CKD at an outpatient clinic.
Methods:
This retrospective study included 1,965 advanced CKD patients between January 1, 2010, and December 31, 2020 in Taiwan. We randomly divided all patients into the training (75%) and testing (25%) datasets. The primary outcome was to predict hyperkalemia (K+ > 5.5 mEq/L) in the next clinic vist. Two nephrologists were enrolled in a human-machine competition. The area under the receiver operating characteristic curves (AUCs), sensitivity, specificity, and accuracy were used to evaluate the performance of XGBoost and conventional logistic regression models with that of these physicians.
Results:
In a human-machine competition of hyperkalemia prediction, the AUC, PPV, and accuracy of the XGBoost model were 0.867 (95% confidence interval: 0.840-0.894), 0.700, and 0.933, which was significantly better than that of our clinicians. There were four variables that were chosen as high-ranking variables in XGBoost and logistic regression models, including hemoglobin, the serum potassium level in the previous visit, angiotensin receptor blocker use, and calcium polystyrene sulfonate use.
Conclusions:
The XGBoost model provided better predictive performance for hyperkalemia than physicians at the outpatient clinic.
Related Concept Videos
Chronic Kidney Disease III: Interprofessional Care
Chronic Kidney Disease IV: Nursing Management
Acute Kidney Injury VI: Nursing Management
Chronic Kidney Disease I: Introduction
Acute Kidney Injury V: Interprofessional Care
Acute Kidney Injury IV: Diagnostic Studies and Prevention

