Explainable Machine Learning for Hypertension Status Classification Using NHANES: Performance and Cross-Model SHAP Analysis
Abstract
Hypertension is a major noncommunicable disease and an important public health concern. Its health burden is relevant to public-health risk management and broader disaster-risk contexts, supporting Sustainable Development Goal 3 (SDG 3), particularly Target 3.4 on reducing premature mortality from noncommunicable diseases. This study compares Logistic Regression (LR), Random Forest (RF), and Extreme Gradient Boosting (XGBoost) for classifying reported hypertension status, evaluates hyperparameter optimization, and examines predictor contributions using SHapley Additive exPlanations (SHAP). Using 5,008 NHANES 2021–2023 respondents and eight predictors, hypertension status was defined from BPQ020 as self-reported physician diagnosis. The data were divided using an 80:20 stratified split into training and independent test sets, with five-fold cross-validation applied to the training set for hyperparameter optimization. At a fixed threshold of 0.50, LR achieved the highest baseline ROC-AUC (0.7921), while XGBoost achieved the highest baseline Recall (0.5968) and F1-Score (0.6233). Tuning improved RF Recall from 0.5332 to 0.6048 and F1-Score from 0.5793 to 0.6316. SHAP identified Age, Waist circumference, and BMI as the top three predictors in both tuned models, with a Spearman rank correlation of 0.9286 and 100% top-three agreement. Bootstrap analysis yielded a median correlation of 0.9286 (95% CI: 0.9048–1.0000), with 100% top-three agreement across 2,000 replications. At the fixed threshold, tuned RF achieved the highest Recall and F1-Score, whereas LR yielded the highest ROC-AUC.
Keywords
Full Text:
PDFReferences
[1] S. M. S. Islam, A. Talukder, M. A. Awal, M. M. U. Siddiqui, M. M. Ahamad, M. M. Ahammed, B. Ahammed, L. B. Rawal, R. Alizadehsani, J. Abawajy, L. Laranjo, C. K. Chow, and R. Maddison. “Machine learning approaches for predicting hypertension and its associated factors using population-level data from three South Asian countries.” Frontiers in Cardiovascular Medicine 9 (2022), p. 839379. DOI: https://doi.org/10.3389/fcvm.2022.839379.
[2] N. Chen, F. Fan, J. Geng, Y. Yang, Y. Gao, H. Jin, Q. Chu, D. Yu, Z. Wang, and J. Shi. “Evaluating the risk of hypertension in residents in primary care in Shanghai, China with machine learning algorithms.” Frontiers in Public Health 10 (2022), p. 984621. DOI: https://doi.org/10.3389/fpubh.2022.984621.
[3] United Nations Department of Economic and Social Affairs. “Goal 3: Ensure healthy lives and promote well-being for all at all ages.” United Nations Sustainable Development Goals. [Online]. Available: https://sdgs.un.org/goals/goal3. Accessed: Sep. 20, 2026.
[4] D. W. Hosmer Jr., S. Lemeshow, and R. X. Sturdivant. Applied Logistic Regression. 3rd ed. Hoboken, NJ, USA: John Wiley & Sons, 2013. DOI: https://doi.org/10.1002/9781118548387.
[5] L. Breiman. “Random forests.” Machine Learning 45.1 (2001), pp. 5–32. DOI: https://doi.org/10.1023/A:1010933404324.
[6] T. Chen and C. Guestrin. “XGBoost: A scalable tree boosting system.” In: Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (2016), pp. 785–794. DOI: https://doi.org/10.1145/2939672.2939785.
[7] I. K. Sifat and M. K. Kibria. “Optimizing hypertension prediction using ensemble learning approaches.” PLOS ONE 19.12 (2024), p. e0315865. DOI: https://doi.org/10.1371/journal.pone.0315865.
[8] A. A. Huang and S. Y. Huang. “Shapely additive values can effectively visualize pertinent covariates in machine learning when predicting hypertension.” The Journal of Clinical Hypertension 25.12 (2023), pp. 1135–1144. DOI: https://doi.org/10.1111/jch.14745.
[9] W. Li, G. Huang, N. Tang, P. Lu, L. Jiang, J. Lv, Y. Qin, Y. Lin, F. Xu, and D. Lei. “Effects of heavy metal exposure on hypertension: A machine learning modeling approach.” Chemosphere 337 (2023), p. 139435. DOI: https://doi.org/10.1016/j.chemosphere.2023.139435.
[10] M. Zhang, X. Xia, Q. Wang, Y. Pan, G. Zhang, and Z. Wang. “Application of machine learning algorithms in predicting new onset hypertension: a study based on the China Health and Nutrition Survey.” Environmental Health and Preventive Medicine 30 (2025), p. 3. DOI: https://doi.org/10.1265/ehpm.24-00270.
[11] A. Sofro, A. Maharani, M. E. Mustafidah, K. N. Khikmah, A. Oktaviarina, and D. Ariyanto. “Traditional logistic regression and machine learning approaches of sociodemographic and anthropometric factors influencing hypertension in athletes.” BAREKENG: Jurnal Ilmu Matematika dan Terapan 20.2 (2026), pp. 1125–1138. DOI: https://doi.org/10.30598/barekengvol20iss2pp1125-1138.
[12] Centers for Disease Control and Prevention, National Center for Health Statistics. “About NHANES.” National Health and Nutrition Examination Survey. [Online]. Available: https://www.cdc.gov/nchs/nhanes/about/index.html. Accessed: Sep. 20, 2026.
[13] S. M. Lundberg and S.-I. Lee. “A unified approach to interpreting model predictions.” Advances in Neural Information Processing Systems, vol. 30 (2017), pp. 4765–4774. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2017/hash/8a20a8621978632d76c43dfd28b67767-Abstract.html.
[14] P. Probst, A.-L. Boulesteix, and B. Bischl. “Tunability: Importance of hyperparameters of machine learning algorithms.” Journal of Machine Learning Research 20.53 (2019), pp. 1–32. [Online]. Available: https://jmlr.org/papers/v20/18-444.html.
[15] R. I. Estiko, B. Widyantoro, D. A. Juzar, R. M. Yusup, I. F. Rakhmat, and E. Rijanto. “Screening hypertension using non-laboratory risk factors with machine learning: a retrospective cross-sectional study in Indonesia.” BMJ Open 15.8 (2025), p. e092364. DOI: https://doi.org/10.1136/bmjopen-2024-092364.
DOI: https://doi.org/10.18860/cauchy.v11i2.45787
Refbacks
- There are currently no refbacks.
Copyright (c) 2026 Diska Nur Isna Apriani, A'yunin Sofro

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Editorial Office
Mathematics Department,
Maulana Malik Ibrahim State Islamic University of Malang
Gajayana Street 50 Malang, East Java, Indonesia 65144
e-mail: cauchy@uin-malang.ac.id

CAUCHY: Jurnal Matematika Murni dan Aplikasi is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.







