Diabetes Prediction Using Logistic Regression and Linear Discriminant Analysis: A Comparative Study
DOI:
https://doi.org/10.5281/zenodo.23757424Keywords:
diabetes prediction, Logistic Regression, Linear Discriminant Analysis, Pima Indians Diabetes Dataset, classification, McNemar test, cross-validation, model validationAbstract
This study compares Logistic Regression (LR) and Linear Discriminant Analysis (LDA) for diabetes classification using the 768-observation Pima Indians Diabetes Dataset, comprising eight predictor variables and a binary outcome (500 non-diabetic and 268 diabetic observations). Zero-coded values in Glucose, Blood Pressure, Skin Thickness, Insulin, and BMI were treated as missing and median-imputed using training data only to prevent data leakage. Both models were evaluated using the same stratified 70:30 train–test split (537 training and 231 test observations; random seed = 42) and stratified ten-fold cross-validation, with preprocessing fitted independently within each fold. On the held-out test set, LR achieved 74.46% accuracy, 53.09% sensitivity, 86.00% specificity, an F1-score of 59.31%, and a ROC-AUC of 0.836. Correspondingly, LDA achieved 73.59% accuracy, 50.62% sensitivity, 86.00% specificity, an F1-score of 57.34%, and a ROC-AUC of 0.835. Across stratified ten-fold cross-validation, the mean accuracy was 76.68% for LR and 76.42% for LDA, while both models achieved a mean ROC-AUC of 0.837 to three decimal places. To statistically compare their paired classification outcomes, an exact two-sided McNemar test was conducted on the held-out predictions. The paired classification table indicated that both models correctly classified 170 observations and misclassified 59 observations; LR correctly classified two additional observations that LDA misclassified, whereas no observations were correctly classified by LDA and misclassified by LR. The resulting exact McNemar p-value was 0.500, indicating no statistically significant difference in the models’ marginal classification performance at the 5% significance level. Taken together, the results suggest comparable predictive performance, with modest numerical advantages for LR in accuracy, sensitivity, F1-score, and test-set ROC-AUC, but insufficient statistical evidence to establish a decisive winner. These findings represent a benchmark comparison rather than clinical validation, and the models’ generalizability should be assessed using independent external datasets before practical clinical application.

