# Diabetes Monitoring System in Smart Health Cities Based on Big Data Intelligence
## 4 Experimental Results and Analysis
### Experiments  
The major target of the proposed system is to predict diabetes and implement the algorithm with the highest accuracy to predict the existence of diabetes in the early stage. In this study, we used K-nearest neighbors, decision tree classifier, deep learning (multilayer perceptron (MLP)), support vector machine (SVM), random forest classifier, an AdaBoost classifier and logistic regression. All these algorithms were applied on the PIMA Indian dataset. Of the records, 80% in the dataset were used for training; the remaining 20% was used for testing. Table 2 lists the obtained results, and the results are visualized in Figure 9.  
Figure 9: The classification algorithms accuracy using 80% training and 20% testing dataset. The performance evaluation used in this research is calculating the accuracy. Compared to previous research, the result of the accuracy of the algorithms in this proposed system is very competitive. The results of the proposed research suggest that an AdaBoost classifier is more suitable for the detection of diabetes in healthcare. The KNN accuracy for diabetes prediction is 79% for training accuracy and 78% for testing accuracy, the training accuracy using DT is 100%. When training a deep learning model to predict diabetes, the training accuracy is 71% and testing accuracy is 67%. For RF, the training accuracy is 100% and testing accuracy is 77.6%. The SVM has a training accuracy of 76.9% and testing accuracy of 75.5%. All results are presented in Table 3, and visualized in Figure 10.  
The training accuracy with DT is 100%, but the testing accuracy is not impressive. After setting the max_depth=3, this leads to a lower training accuracy, but testing accuracy is improved; the training accuracy becomes 77% and the testing accuracy becomes 74%. As we mentioned before, scaling the data negatively affected the MLP accuracy. Therefore, we re-scaled the data to achieve significant requirements for predicting diabetes accurately; the training accuracy becomes 82% and the testing accuracy becomes 80%. However, if iterations are increased, more alpha and other parameter will be added to the model weights, this leads to a training accuracy of 79% and a testing accuracy of 79%. RF has a training accuracy of 100% and testing accuracy of 77.6%. Setting the max_depth to 2, a \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline
**Classification Algorithms** & **Training Accuracy** & **Testing Accuracy** \\ \hline
**KNN** & 77\% & 73\% \\ \hline
**Decision Tree** & 76\% & 79.2\% \\ \hline
**Random Forest** & 75.7\% & 74\% \\ \hline
**SVM** & 76.7\% & 76\% \\ \hline
**MLP** & 82.5\% & 77.1\% \\ \hline
**An AdaBoost** & 83.9\% & 75.5\% \\ \hline
**Logistic regression** & 75.9\% & 80.2\% \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The classification algorithms accuracy using 80% training and 20% testing dataset. Figure 10: The first result for classification algorithms accuracy. lower training accuracy is achieved, but testing accuracy is improved; the training accuracy is 76.2% and the testing accuracy is 75%. The proposed system proved the best two models are the deep learning model after scaling and an AdaBoost classifier by the same training accuracy of 82% and testing accuracy of 80% for the DL model. After scaling the data, the training accuracy is 78.6% for the AdaBoost classifier. Table 4 presents the final result for classification algorithms accuracy, visualized in Figure 11.  
The maximum depth of the tree is defined by max_depth. Here, a depth three is employed to improve the proposed decision tree. Over-fitted DTs are achieved due to the zero value, which is set by default. max_depth in RF denotes each tree depth in the forest, more splits are accordingly related to the deeper trees, and extra information from data is released.