Predicting Cardiovascular Disease: Leveraging Demographic and Clinical Data with Machine Learning
Asifiwe Makawa *
School of Computational and Communication Science and Engineering, Nelson Mandela African Institution of Science and Technology (NM-AIST), P.O. Box 447, Arusha, Tanzania.
Mussa Ally
School of Computational and Communication Science and Engineering, Nelson Mandela African Institution of Science and Technology (NM-AIST), P.O. Box 447, Arusha, Tanzania.
Elingarami Nkya
School of Life Sciences and Bio-Engineering, Nelson Mandela African Institution of Science and Technology (NM-AIST), P.O. Box 447, Arusha, Tanzania.
Pedro Pallangyo
Directorate of Cardiology, Jakaya Kikwete Cardiac Institute (JKCI), P. O. Box 65141, Dar es Salaam, Tanzania.
*Author to whom correspondence should be addressed.
Abstract
Aims: Cardiovascular disease (CVD) remains the leading cause of global morbidity and mortality and disproportionately affects low- and middle-income countries (LMICs), including the Sub-Saharan Africa (SSA) region. Traditional risk scores rely on a limited set of linear predictors and frequently fail to detect asymptomatic and subclinical disease. This study aimed to develop and validate an advanced machine learning (ML) model to predict CVD risk using routinely collected demographic and clinical data, integrated with Renin-Angiotensin-Aldosterone System (RAAS) biomarkers derived from vital signs and laboratory reports.
Study Design: A retrospective, cross-sectional analysis of de-identified outpatient electronic medical records (EMR).
Methodology: A dataset of 3,840 de-identified outpatient records was extracted from the JKCI EMR database with 18 demographic and clinical features. Age, sex, blood pressure, lipid profiles, BMI, HbA1c, electrolytes, liver and renal markers were preprocessed through cleaning, expert labeling, encoding, and class balancing using the Synthetic Minority Over-sampling Technique (SMOTE). Five supervised algorithms (Logistic Regression, K-Nearest Neighbors, Support Vector Machine, Random Forest, and XGBoost) were trained and evaluated using accuracy, precision, recall, specificity, F1-score, ROC-AUC, and ten-fold cross-validation. Local Interpretable Model-agnostic Explanation (LIME) was applied for interpretability.
Results: Random Forest achieved the highest performance (accuracy = 92.5%, recall = 90.0%, specificity = 93.0%, ROC-AUC = 0.94), outperforming all other ML models. Ten-fold cross-validation accuracy consistently exceeded 94%. Feature importance analysis identified age, LDL cholesterol, systolic blood pressure, HbA1c, and BMI as the most influential predictors, consistent with the established clinical evidence. LIME visualization illustrated the trustworthiness and usefulness of the explainable AI outputs for clinical decision support.
Conclusion: Leveraging demographics, clinical data, and RAAS biomarkers with machine learning markedly enhances early CVD risk prediction in asymptomatic patients, supporting scalable, data-driven precision cardiology.
Keywords: Cardiovascular disease, machine learning, random forest, RAAS biomarkers, explainable artificial intelligence