# Machine Learning-Based Approach for Predicting Diabetes Employing Socio-Demographic Characteristics
## 3 Result Analysis and Discussion
### Performance Evaluation of ML Models  
Six machine learning models such as MLP, SVM, DT, LGBM, XGB, and RF were applied and their performances were compared to each other to find the best-fit model to predict diabetes in the early stage. The results of the ML models are represented in the following sections. At first, the imbalanced dataset was trained using the train-test split method, where 70% of the dataset was utilized to train the model, and 30% of the dataset was employed for testing the built models. The result of the train-test split method on the imbalanced dataset is represented in Table 2. According to Table 2, the lowest performance is generated by SVM and MLP classifiers. RF has the highest accuracy score of 98.44% among the six ML algorithms. Furthermore, RF also gives the maximum scores for the rest of the performance metrics: precision, recall, f1-score, sensitivity, specificity, kappa statistics, and MCC value, which are, respectively, 0.9800, 0.9899, 0.9849, 0.9785, 0.9899, 0.9687, and 0.9687. Table 3 shows the results for different performance metrics on the imbalanced dataset. RF has the highest accuracy score of 98.44% among the six ML algorithms. Furthermore, RF also gives the maximum scores for the rest of the performance metrics: precision, recall, f1-score, sensitivity, specificity, kappa statistics, and MCC value, which are, respectively, 0.9800, 0.9899, 0.9849, 0.9785, 0.9899, 0.9687, and 0.9687. Table 4 represents detailed information about the ML approaches for five-fold CV results on the balanced dataset. The maximum CV accuracy is 94.87% for RF classifiers. DT shows the highest precision value of 0.9784, and RF gives the highest recall and f1-scores of 0.9608 and 0.9608. At the same time, DT also gains the maximum sensitivity value of 0.9629. The maximum specificity, kappa statistics, and MCC values given through RF are 0.9608, 0.8867, and 0.8867, respectively. \begin{table}
\begin{tabular}{l c c c c c c c c} \hline \hline
**Algorithm Accuracy** & **Precision** & **Recall** & **F1-Score** & **Sensitivity** & **Specificity** & **Kappa Statistics** & **MCC** \\ \hline DT & 91.61\% & 0.9784 & 0.8921 & 0.9333 & 0.9629 & 0.8921 & 0.8228 & 0.8291 \\ SVM & 89.74\% & 0.8981 & 0.9509 & 0.9238 & 0.7963 & 0.9509 & 0.7673 & 0.7703 \\ XGB & 92.95\% & 0.9691 & 0.9216 & 0.9447 & 0.9444 & 0.9216 & 0.8475 & 0.8496 \\ LGBM & 92.95\% & 0.9691 & 0.9216 & 0.9447 & 0.9444 & 0.9216 & 0.8475 & 0.8496 \\ MLP & 92.95\% & 0.9505 & 0.9412 & 0.9458 & 0.9074 & 0.9412 & 0.8449 & 0.845 \\
**RF** & **94.87\%** & **0.9608** & **0.9608** & **0.9259** & **0.9608** & **0.8867** & **0.8867** \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Performance evaluation on balance dataset for five-fold CV method. \begin{table}
\begin{tabular}{l c c c c c c c} \hline \hline
**Algorithm Accuracy** & **Precision** & **Recall** & **F1-Score** & **Sensitivity** & **Specificity** & **Kappa Statistics** & **MCC** \\ \hline SVM & 92.19\% & 0.9117 & 0.9394 & 0.9254 & 0.9032 & 0.9394 & 0.8434 & 0.8438 \\ MLP & 93.23\% & 0.9388 & 0.9293 & 0.934 & 0.9355 & 0.9293 & 0.8645 & 0.8645 \\ LGBM & 94.27\% & 0.9782 & 0.9091 & 0.9424 & 0.9785 & 0.9091 & 0.8855 & 0.8879 \\ XGB & 96.35\% & 0.9791 & 0.9495 & 0.9641 & 0.9785 & 0.9495 & 0.9271 & 0.9275 \\ DT & 97.39\% & 0.9896 & 0.9596 & 0.9743 & 0.9892 & 0.9596 & 0.9479 & 0.9484 \\
**RF** & **98.44\%** & **0.98** & **0.9899** & **0.9849** & **0.9785** & **0.9899** & **0.9687** & **0.9687** \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Performance evaluation on imbalance dataset for train–test split method.