# Early Diagnosis of Dementia from Clinical Data by Machine Learning Techniques
## 4 Results and Discussion
### Phase 2  
As mentioned in Section 3, Phase 2 classifies MCI and dementia. The results of any use of data mining techniques are based on Table 10. This table shows the achieved accuracy based on the MCI and dementia classes of feature in Table 6.  
Taking the results of Table 10, Figure 5 shows the comparison of the accuracy of these criteria: precision, recall and F-measure. According to Figure 5, the highest precision recall and F-measure accuracy in Phase 1 belongs to SVM with 0.739, 0.738, and 0.739, respectively, followed by logistic regression and random forest. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Algorithms** & **TP Rate** & **FP Rate** & **Precision** & **Recall** & **F-Measure** \\ \hline SVM & 0.738 & 0.262 & 0.739 & 0.738 & 0.739 \\ Logistic Regression & 0.736 & 0.265 & 0.736 & 0.736 & 0.736 \\ Random Forest & 0.729 & 0.272 & 0.729 & 0.729 & 0.729 \\ Bagging & 0.724 & 0.276 & 0.724 & 0.724 & 0.724 \\ Naive Bayes & 0.712 & 0.289 & 0.713 & 0.712 & 0.712 \\ Bayes Network & 0.709 & 0.292 & 0.708 & 0.709 & 0.708 \\ MLP & 0.679 & 0.321 & 0.679 & 0.679 & 0.680 \\ \hline \hline \end{tabular}
\end{table} 
Table 10: The Results of Classification Based on Phase 2 (MCI, dementia). Figure 4: The Comparison of Data Classification Accuracy in Phase 1. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Algorithms** & **Correctly Classified Instances** & **Incorrectly Classified Instances** \\  & **(\%)** & **(\%)** \\ \hline MLP & 97.2 & 2.8 \\ Random Forest & 96.3 & 3.7 \\ Bagging & 94.4 & 5.6 \\ SVM & 91.8 & 8.2 \\ Logistic Regression & 91.7 & 8.3 \\ Bayes Net & 83.3 & 16.7 \\ Naive Bayes & 81.3 & 18.6 \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Data Classification Accuracy of Dementia by Evaluating Experimental Data. Each algorithm has a level of error in the diagnosis of dementia. By using four criteria (MAE, RMSE, RAE and RRSE, in the Table 11) any technical errors in the diagnosis of dementia are shown. Given the results of Table 11, Figure 6 compares the errors in the diagnosis of dementia by these criteria MAE, RMSE, RAE and RRSE, to discern which algorithms of these criteria have the lowest error. According to Figure 6, SVM has the lowest error in the MAE criterion compared to other algorithms. Also, the level of error for Naive Bayes is close to the SVM and after SVM has less error than the other algorithms in the diagnosis of dementia. Regarding RMSE, based on Figure 6, random forest and bagging had the lowest error in RMSE criterion compared to other algorithms; the level of error in bagging, random forest and logistic regression is very close together. Figure 6 also shows that SVM has the lowest error in RRSE criterion compared to other algorithms. After SVM, Naive Bayes has a level of error close to it, and the lowest error to diagnosis of heart disease. Finally, in regard to RRSE, as Figure 6 shows, logistic regression has the lowest error by the RRSE criterion when compared to other algorithms. After logistic regression, Bayes Network had the lowest error for the diagnosis of dementia. As noted, Phase 2 data have been tested and their data classification accuracy rate for diagnosis of cognitive decline assessed according to Equation (7). According to Table 12, the comparison of data classification accuracy for diagnosis of dementia is shown in Figure 7. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Algorithms** & **Mean Absolute** & **Root Mean** & **Relative Absolute** & **Root Relative** \\  & **Error** & **Squared Error** & **Error** & **Squared Error** \\ \hline Logistic Regression & 0.35 & 0.43 & 70.20 & 85.27 \\ MLP & 0.33 & 0.54 & 65.53 & 107.86 \\ Naive Bayes & 0.29 & 0.51 & 57.43 & 101.64 \\ Random Forest & 0.37 & 0.43 & 73.54 & 85.29 \\ SVM & 0.26 & 0.51 & 52.87 & 102.83 \\ Bagging & 0.36 & 0.43 & 72.20 & 86.10 \\ Bayes Net & 0.29 & 0.50 & 57.83 & 100.72 \\ \hline \hline \end{tabular}
\end{table} 
Table 11: The Results of Errors Obtained from Classification to Diagnosis of Dementia (Phase 2).