Comparative Performance of Logistic Regression and Random Forest for Diabetes Prediction Using the UCI Centers for Disease Control and Prevention Diabetes Health Indicators Dataset

2026

Full text Open access: Hybrid Metadata (CSL-JSON)
DOI 10.4103/wkpj.wkpj_23_26
Data confidence 70 medium
How this score is calculated

It is built from checkable properties of the record itself: whether the article has a DOI, how many independent sources confirmed its data, whether the required fields are filled in, and how recent the latest confirmation is. Disagreement between sources and a missing identifier lower it. A value of 80 or above means the record was published without further checking; 60 to 79 means it is published at reduced confidence, with a manual check advisable. A record verified by an editor by hand is never pushed below 90 by a recalculation. This scores our data about the article, not the article itself.

Abstract

A BSTRACT Objective: The objective of this study was to compare the performance of logistic regression and random forest models for diabetes prediction using the University of California, Irvine (UCI) Centers for Disease Control and Prevention (CDC) diabetes health indicators dataset. Materials and Methods: A secondary analysis was conducted using the binary version of the CDC diabetes health indicators dataset obtained from the UCI machine learning repository. The dependent variable was diabetes status (diabetes_binary), coded as 0 for no diabetes and 1 for diabetes. Predictor variables included health-related and lifestyle-related indicators such as high blood pressure, high cholesterol, cholesterol check status, body mass index, smoking, stroke history, heart disease or heart attack, physical activity, fruit and vegetable consumption, and heavy alcohol consumption. The dataset was divided into training (80%) and testing (20%) subsets using a stratified split. Logistic regression and random forest were trained in Python. Model performance was evaluated using accuracy, precision, recall, F1-score, confusion matrices, and the area under the receiver operating characteristic curve (AUC). Results: Logistic regression achieved an accuracy of 0.746, precision of 0.737, recall of 0.764, F1-score of 0.750, and AUC of 0.823. Random forest achieved an accuracy of 0.736, precision of 0.720, recall of 0.772, F1-score of 0.740, and AUC of 0.812. Logistic regression showed better overall performance in terms of accuracy, precision, F1-score, and AUC, whereas random forest demonstrated slightly higher recall. Conclusion: Both machine learning models demonstrated satisfactory performance for diabetes prediction. Logistic regression showed the most balanced overall performance and may be more suitable for this dataset, particularly when interpretability is important. These findings support the use of machine learning methods for diabetes risk assessment in public health research.