Predicting Hyperkalemia in Patients with Chronic Kidney Disease Using the CatBoost Model and Multiple Interpretability Analyses
Abstract
1. Introduction
- Clinical data from patients with CKD and CKD-associated hyperkalemia were extracted from the MIMIC database, and data preprocessing work was performed on them.
- The study employed six machine learning models to predict the risk of hyperkalemia in CKD patients. The optimal model was selected based on different evaluation metrics and further assessed by DCA for its clinical utility.
- Multiple interpretability analyses were conducted on the optimal model: SHAP analysis can precisely quantify the positive or negative impacts of key risk factors, while LIME methods provide a comprehensive ranking of risk factors and clearly visualize the ranges within which different indicators exert their influential effects. By integrating the analyses, we gain a deep understanding of the magnitude and polarity of each medical indicator’s impact on the prediction, accurately grasp the distribution of all samples across different indicators, and pinpoint the value ranges within which each indicator plays a dominant role in determining the outcome. This approach enhances clinicians’ understanding of the machine learning-assisted diagnostic process and fosters greater trust in the diagnostic outcomes.
2. Related Work
3. Materials and Methods
3.1. Datasets
3.2. Data Pre-Processing
3.3. Model Construction
- RF: A Bagging-based ensemble learning algorithm, it enhances model stability and generalization ability by constructing numerous decision trees and aggregating their predictions [29]. RF was selected as a classic and robust representative of ensemble learning.
- MLP: A fundamental feedforward neural network capable of capturing complex nonlinear relationships through learned hierarchical feature representations [30]. In the experiments, it serves as a baseline deep model to evaluate the added value of more complex architectures.
- FTT: A deep learning architecture built on the self-attention mechanism, specifically designed for tabular data [31]. We introduced FTT as an exploration of advanced deep learning architectures, aiming to utilize the potential of attention mechanisms in handling heterogeneous features.
- TabPFN: A deep learning model specifically designed for tabular data, which employs Prior-Data Fitted Networks (PFNs) to achieve sample-efficient inference [32]. It was chosen for the advantage in small-sample prediction.
- XGBoost: A gradient-boosted tree framework incorporating L1/L2 regularization to prevent overfitting, with native support for categorical feature encoding [33]. XGBoost was selected because it is widely regarded as a mainstream high-performance benchmark model for structured tabular data.
- CatBoost: An ensemble tree algorithm featuring ordered target encoding for categorical variables and symmetric oblivious trees to mitigate prediction shift caused by noisy data points [34]. It was selected for its specialized optimization for categorical data, which is well-suited to clinical datasets with numerous categorical features.
3.4. Hyperparameters Tuning
4. Results
4.1. Model Evaluation
- Accuracy
- 2.
- Recall
- 3.
- Precision
- 4.
- F1-score
- 5.
- Receiver Operating Characteristic (ROC) Curve
- 6.
- Matthews Correlation Coefficient (MCC)
4.2. Multiple Interpretability Analyses
4.2.1. SHAP Analysis
4.2.2. LIME Analysis
5. Discussion
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A
| Features | |
|---|---|
| early prediction | gender, age, bmi, rbc, wbc, hemoglobin, hematocrit, platelet, creatinine, glucose, bun, calcium, severe_liver_disease, chronic_pulmonary_disease, mild_liver_disease, diabetes_with_cc, diabetes_without_cc, peripheral_vascular_disease, charlson_comorbidity_index, metastatic_solid_tumor, malignant_cancer, paraplegia, alt, alp, ast, bilirubin_total, heart_rate_mean, temperature_mean, spo2_min, resp_rate_min, diagnosis |
References
- Jha, V.; Garcia-Garcia, G.; Iseki, K.; Li, Z.; Naicker, S.; Plattner, B.; Saran, R.; Wang, A.Y.M.; Yang, C.W. Chronic kidney disease: Global dimension and perspectivesl. Lancet 2013, 382, 260–272. [Google Scholar] [CrossRef] [PubMed]
- Ene-Iordache, B.; Perico, N.; Bikbov, B.; Carminati, S.; Remuzzi, A.; Perna, A.; Islam, N.; Bravo, R.F.; Aleckovic-Halilovic, M.; Zou, H.; et al. Chronic kidney disease and cardiovascular risk in six regions of the world (ISN-KDDC): A cross-sectional study. Lancet Glob. Health 2016, 4, e307–e319. [Google Scholar] [CrossRef]
- Pazianas, M.; Miller, P.D. Osteoporosis and chronic kidney disease-mineral and bone disorder (CKD-MBD): Back to basics. Am. J. Kidney Dis. 2021, 78, 582–589. [Google Scholar] [CrossRef]
- Sarafidis, P.A.; Georgianos, P.I.; Bakris, G.L. Advances in treatment of hyperkalemia in chronic kidney disease. Expert Opin. Pharmacother. 2015, 16, 2205–2215. [Google Scholar] [CrossRef] [PubMed]
- Einhorn, L.M.; Zhan, M.; Walker, L.D.; Moen, M.F.; Seliger, S.L.; Weir, M.R.; Fink, J.C. The frequency of hyperkalemia and its significance in chronic kidney disease. Arch. Intern. Med. 2009, 169, 1156–1162. [Google Scholar] [CrossRef]
- Vega, L.B.; Galabia, E.R.; da Silva, J.B.; González, M.B.; Fresnedo, G.F.; Haces, C.P.; Fontanet, R.P.; San Millán, J.C.R.; de Francisco, Á.L.M. Epidemiology of hyperkalemia in chronic kidney disease. Nefrol. (Engl. Ed.) 2019, 39, 277–286. [Google Scholar]
- Kashihara, N.; Kohsaka, S.; Kanda, E.; Okami, S.; Yajima, T. Hyperkalemia in real-world patients under continuous medical care in Japan. Kidney Int. Rep. 2019, 4, 1248–1260. [Google Scholar] [CrossRef]
- Collins, A.J.; Pitt, B.; Reaven, N.; Funk, S.; McGaughey, K.; Wilson, D.; Bushinsky, D.A. Association of serum potassium with all-cause mortality in patients with and without heart failure, chronic kidney disease, and/or diabetes. Am. J. Nephrol. 2017, 46, 213–221. [Google Scholar] [CrossRef]
- Cheng, X.; Changlin, M. Long-term management of hyperkalemia in chronic kidney disease. Chin. J. Nephrol. 2021, 37, 380–384. [Google Scholar]
- Kovesdy, C.P. Updates in hyperkalemia: Outcomes and therapeutic strategies. Rev. Endocr. Metab. Disord. 2017, 18, 41–47. [Google Scholar] [CrossRef]
- Sarker, I.H. Machine learning: Algorithms, real-world applications and research directions. SN Comput. Sci. 2021, 2, 160. [Google Scholar] [CrossRef]
- Sharma, A.; Alvarez, P.J.; Woods, S.D.; Dai, D. A model to predict risk of hyperkalemia in patients with chronic kidney disease using a large administrative claims database. Clin. Outcomes Res. 2020, 12, 657–667. [Google Scholar] [CrossRef]
- Israni, R.; Betts, K.A.; Mu, F.; Davis, J.; Wang, J.; Anzalone, D.; Uwaifo, G.I.; Szerlip, H.; Fonseca, V.; Wu, E. Determinants of hyperkalemia progression among patients with mild hyperkalemia. Adv. Ther. 2021, 38, 5596–5608. [Google Scholar] [CrossRef] [PubMed]
- Kim, H.; Ko, A. # 619 Serum aldosterone to potassium ratio and hyperkalemia risk in patients with chronic kidney disease. Nephrol. Dial. Transplant. 2024, 39, I2220–I2221. [Google Scholar]
- Kurzinski, K.L.; Xu, Y.; Ng, D.K.; Furth, S.L.; Schwartz, G.J.; Warady, B.A.; CKiD Study Investigators. Hyperkalemia in pediatric chronic kidney disease. Pediatr. Nephrol. 2023, 38, 3083–3090. [Google Scholar] [CrossRef]
- Chang, H.-H.; Chiang, J.-H.; Tsai, C.-C.; Chiu, P.-F. Predicting hyperkalemia in patients with advanced chronic kidney disease using the XGBoost model. BMC Nephrol. 2023, 24, 169. [Google Scholar] [CrossRef] [PubMed]
- You, J.S.; Park, Y.S.; Chung, H.S.; Lee, H.S.; Joo, Y.; Park, J.W.; Chung, S.P.; Lee, S.H.; Lee, H.S. Evaluating the utility of rapid point-of-care potassium testing for the early identification of hyperkalemia in patients with chronic kidney disease in the emergency department. Yonsei Med. J. 2014, 55, 1348–1353. [Google Scholar] [CrossRef]
- Kohsaka, S.; Okami, S.; Kanda, E.; Kashihara, N.; Yajima, T. Cardiovascular and renal outcomes associated with hyperkalemia in chronic kidney disease: A hospital-based cohort study. Mayo Clin. Proc. Innov. Qual. Outcomes 2021, 5, 274–285. [Google Scholar] [CrossRef]
- Kanda, E.; Okami, S.; Kohsaka, S.; Okada, M.; Ma, X.; Kimura, T.; Shirakawa, K.; Yajima, T. Machine learning models predicting cardiovascular and renal outcomes and mortality in patients with hyperkalemia. Nutrients 2022, 14, 4614. [Google Scholar] [CrossRef]
- Craven, M.; Shavlik, J. Extracting tree-structured representations of trained networks. Adv. Neural Inf. Process. Syst. 1995, 8, 24–30. [Google Scholar]
- Lundberg, S.M.; Lee, S.I. A unified approach to interpreting model predictions. Adv. Neural Inf. Process. Syst. 2017, 30, 4768. [Google Scholar]
- Ribeiro, M.T.; Singh, S.; Guestrin, C. “Why should i trust you?” Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016; pp. 1135–1144. [Google Scholar]
- Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention is all you need. Adv. Neural Inf. Process. Syst. 2017, 30, 5998. [Google Scholar]
- Johnson, A.; Bulgarelli, L.; Pollard, T.; Horng, S.; Celi, L.A.; Mark, R. MIMIC-IV, Version 2.0; PhysioNet: Boston, MA, USA, 2022. [Google Scholar]
- Bu, Z.J.; Jiang, N.; Li, K.C.; Lu, Z.L.; Zhang, N.; Yan, S.S.; Chen, Z.L.; Hao, Y.H.; Zhang, Y.H.; Xu, R.B.; et al. Development and validation of an interpretable machine learning model for early prognosis prediction in ICU patients with malignant tumors and hyperkalemia. Medicine 2024, 103, e38747. [Google Scholar] [CrossRef] [PubMed]
- Aljrees, T. Improving prediction of cervical cancer using KNN imputer and multi-model ensemble learning. PLoS ONE 2024, 19, e0295632. [Google Scholar] [CrossRef]
- Bennett, D.A. How can I deal with missing data in my study? Aust. N. Z. J. Public Health 2001, 25, 464–469. [Google Scholar] [CrossRef]
- Balaram, A.; Vasundra, S. Prediction of software fault-prone classes using ensemble random forest with adaptive synthetic sampling algorithm. Autom. Softw. Eng. 2022, 29, 6. [Google Scholar] [CrossRef]
- Mendapara, K. Development and evaluation of a chronic kidney disease risk prediction model using random forest. Front. Genet. 2024, 15, 1409755. [Google Scholar] [CrossRef]
- Joo, Y.; Namgung, E.; Jeong, H.; Kang, I.; Kim, J.; Oh, S.; Lyoo, I.K.; Yoon, S.; Hwang, J. Brain age prediction using combined deep convolutional neural network and multi-layer perceptron algorithms. Sci. Rep. 2023, 13, 22388. [Google Scholar] [CrossRef]
- Gorishniy, Y.; Rubachev, I.; Khrulkov, V.; Babenko, A. Revisiting deep learning models for tabular data. Adv. Neural Inf. Process. Syst. 2021, 34, 18932–18943. [Google Scholar]
- Hollmann, N.; Müller, S.; Eggensperger, K.; Hutter, F. Tabpfn: A transformer that solves small tabular classification problems in a second. arXiv 2022, arXiv:2207.01848. [Google Scholar]
- Liu, L.; Cui, S.; Hou, J.; May, N.S.; Luo, J.J. Risk Prediction for Alzheimer’s Disease Mortality: Using XGBoost Survival Analysis. Ann. Epidemiol. 2024, 97, 93. [Google Scholar] [CrossRef]
- Wei, X.; Rao, C.; Xiao, X.; Chen, L.; Goh, M. Risk assessment of cadiovascular disease based on SOLSSA-CatBoost model. Expert Syst. Appl. 2023, 219, 119648. [Google Scholar] [CrossRef]
- Akiba, T.; Sano, S.; Yanase, T.; Ohta, T.; Koyama, M. Optuna: A next-generation hyperparameter optimization framework. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, Anchorage, AK, USA, 4–8 August 2019; pp. 2623–2631. [Google Scholar]
- Chicco, D.; Jurman, G. The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation. BMC Genom. 2020, 21, 6. [Google Scholar] [CrossRef] [PubMed]
- Hastie, T. The Elements of Statistical Learning: Data Mining, Inference, and Prediction; Springer: New York, NY, USA, 2009. [Google Scholar]
- Vanacore, A.; Pellegrino, M.S.; Ciardiello, A. Fair evaluation of classifier predictive performance based on binary confusion matrix. Comput. Stat. 2024, 39, 363–383. [Google Scholar] [CrossRef]
- Fernández Alba, J.J.; Carral, F.; Ayala Ortega, C.; Santotoribio, J.D.; Lara, M.C.; González Macías, C. External Validation of a Predictive Model for Thyroid Cancer Risk with Decision Curve Analysis. Diagnostics 2025, 15, 686. [Google Scholar] [CrossRef] [PubMed]
- Rudin, C.; Chen, C.; Chen, Z.; Huang, H.; Semenova, L.; Zhong, C. Interpretable machine learning: Fundamental principles and 10 grand challenges. Stat. Surv. 2022, 16, 1–85. [Google Scholar] [CrossRef]
- Qi, J.; Yang, R.; Wang, P. Application of explainable machine learning based on Catboost in credit scoring. In Journal of Physics: Conference Series; IOP Publishing: Bristol, UK, 2021; Volume 1955, pp. 1–7. [Google Scholar]
- Stevens, P.E.; Ahmed, S.B.; Carrero, J.J.; Foster, B.; Francis, A.; Hall, R.K.; Herrington, W.G.; Hill, G.; Inker, L.A.; Kazancıoğlu, R.; et al. Kidney Disease: Improving Global Outcomes (KDIGO) CKD Work Group. KDIGO 2012 clinical practice guideline for the evaluation and management of chronic kidney disease. Kidney Int. Suppl. 2013, 3, S117–S314. [Google Scholar]
- Kim, H.W.; Park, J.T.; Yoo, T.H.; Lee, J.; Chung, W.; Lee, K.B.; Chae, D.W.; Ahn, C.; Kang, S.W.; Choi, K.H.; et al. Urinary potassium excretion and progression of CKD. Clin. J. Am. Soc. Nephrol. 2019, 14, 330–340. [Google Scholar] [CrossRef]
- Chawla, T.; Sharma, D.; Singh, A. Role of the renin angiotensin system in diabetic nephropathy. World J. Diabetes 2010, 1, 141. [Google Scholar] [CrossRef]
- Hu, H.; Liang, W.; Ding, G. Ion homeostasis in diabetic kidney disease. Trends Endocrinol. Metab. 2024, 35, 142–150. [Google Scholar] [CrossRef]
- Pal, N.; Sivaswamy, N.; Mahmod, M.; Yavari, A.; Rudd, A.; Singh, S.; Dawson, D.K.; Francis, J.M.; Dwight, J.S.; Watkins, H.; et al. Effect of selective heart rate slowing in heart failure with preserved ejection fraction. Circulation 2015, 132, 1719–1725. [Google Scholar] [CrossRef] [PubMed]








| Model | Value Range |
|---|---|
| RF | n_estimators: (100, 500), max_depth: (3, 20), min_samples_split: (2, 20), min_samples_leaf: (1, 10), |
| FTT | input_embed_dim: (1, 100), attn_dropout: (0.01, 1), num_heads: (1, 100) |
| MLP | hidden_layer_sizes: ([(50,), (100,), (50, 50), (100, 50), (100, 100), (200, 100)]), alpha: (1 × 10−5, 0.1), learning_rate_init: (0.001, 0.1) |
| XGBoost | learning_rate: (0.01, 0.3), n_estimators: (100, 1000), max_depth: (3, 20) |
| CatBoost | iterations: (100, 1000), depth: (3, 16), learning_rate: (0.001, 0.1) |
| Model | Value |
|---|---|
| RF | n_estimators: 235 max_depth: 30 min_samples_split: 7 min_samples_leaf: 3 |
| FTT | input_embed_dim: 72 attn_dropout: 0.19 num_heads: 6 |
| MLP | hidden_layer_sizes: (100, 100) alpha: 4.883 × 10−5 learning_rate_init: 0.021 |
| XGBoost | learning_rate: 0.063 n_estimators: 672 max_depth: 7 |
| CatBoost | iterations: 345 depth: 8 learning_rate: 0.096 |
| Model | Accuracy | Precision | Recall | F1-Score | MCC |
|---|---|---|---|---|---|
| RF | 88.79% | 93.43% | 78.33% | 82.66% | 70.16% |
| FTT | 89.66% | 93.88% | 80.00% | 84.24% | 72.56% |
| MLP | 86.21% | 85.73% | 76.69% | 79.60% | 65.64% |
| TabPFN | 90.52% | 90.81% | 83.84% | 86.55% | 74.83% |
| XGBoost | 87.93% | 88.75% | 78.84% | 82.15% | 70.67% |
| CatBoost | 92.44% | 95.26% | 85.00% | 88.69% | 79.62% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Liu, Y.; Chen, J.; Huang, Y. Predicting Hyperkalemia in Patients with Chronic Kidney Disease Using the CatBoost Model and Multiple Interpretability Analyses. Electronics 2026, 15, 291. https://doi.org/10.3390/electronics15020291
Liu Y, Chen J, Huang Y. Predicting Hyperkalemia in Patients with Chronic Kidney Disease Using the CatBoost Model and Multiple Interpretability Analyses. Electronics. 2026; 15(2):291. https://doi.org/10.3390/electronics15020291
Chicago/Turabian StyleLiu, Yuqi, Jiaqing Chen, and Yangxin Huang. 2026. "Predicting Hyperkalemia in Patients with Chronic Kidney Disease Using the CatBoost Model and Multiple Interpretability Analyses" Electronics 15, no. 2: 291. https://doi.org/10.3390/electronics15020291
APA StyleLiu, Y., Chen, J., & Huang, Y. (2026). Predicting Hyperkalemia in Patients with Chronic Kidney Disease Using the CatBoost Model and Multiple Interpretability Analyses. Electronics, 15(2), 291. https://doi.org/10.3390/electronics15020291

