# Early Diagnosis of Dementia from Clinical Data by Machine Learning Techniques
## 4 Results and Discussion
### Phase 1  
As mentioned in Section 3, Phase 1 classifies subjects into categories of normal and cognitive decline. The results of any use of data mining techniques are based on Table 7. This table shows the achieved accuracy based on normal and cognitive decline class of features in Table 5.  
Given the results of Table 7, Figure 2 shows the comparison of the accuracy of these criteria: precision, recall and F-measure. According to Figure 2, the highest precision recall and F-measure accuracy in Phase 1 belongs to MLP with 0.97, 0.97, and 0.97, respectively, followed by random forest and bagging. Each algorithm has a level of error in the diagnosis of dementia; by using four criteria--Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), Relative Absolute Error (RAE) and Root Relative Squared Error (RRSE) in the Table 8--any technical errors in the diagnosis of dementia is shown. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Algorithms** & **TP Rate** & **FP Rate** & **Precision** & **Recall** & **F-Measure** \\ \hline MLP & 0.97 & 0.04 & 0.97 & 0.97 & 0.97 \\ Random Forest & 0.95 & 0.05 & 0.96 & 0.95 & 0.96 \\ Bagging & 0.93 & 0.07 & 0.94 & 0.93 & 0.93 \\ SVM & 0.90 & 0.10 & 0.91 & 0.90 & 0.90 \\ Bayes Network & 0.90 & 0.10 & 0.91 & 0.90 & 0.90 \\ Logistic Regression & 0.78 & 0.22 & 0.81 & 0.78 & 0.79 \\ Naive Bayes & 0.74 & 0.26 & 0.80 & 0.74 & 0.75 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: The Results of Classification Based on Phase 1 (normal, cognitive decline). TP (True Positives); FP (False Positives); FN (False Negative); Support Vector Machine (SVM). Figure 2: Comparison of Classification Based on the Precision, Recall and F-measure Criteria for Diagnosis of Dementia (Phase 1). According to the results of Table 8, Figure 3 shows the comparison of the level of error for the diagnosis of dementia by these criteria MAE, RMSE, RAE and RRSE, to decide which algorithms of these criteria have the lowest error. According to Figure 3, concerning MAE, MLP has the lowest error in MAE criterion compared to other algorithms. Also, the level of error with SVM is close to that of MLP and, after MLP, it has less error than other algorithms in diagnosis of dementia. Based on Figure 3, MLP also has the lowest error in RMSE criterion compared to other algorithms; the level of error in random forest, bagging, and logistic regression is almost identical. In regard to RAE, Figure 3 shows that MLP has the lowest error in RAE criterion compared to other algorithms. Furthermore, SVM follows MLP in having less error than other algorithms in diagnosis of dementia. Finally, in regard to RRSE, as Figure 3 shows, MLP has the lowest error in RRSE criterion compared to other algorithms. And after MLP, random forest and bagging are closer together in level of error, with the lowest error in the diagnosis of dementia. As noted, the Phase 1 data are tested and the data classification accuracy rate for diagnosis of cognitive decline is performed by testing data according to Equation (7). \[Accuracy=\frac{TP+TN}{TP+TN+FP+FN} \tag{7}\]  
According to Table 9, the comparison of data classification accuracy for diagnosis of dementia is shown in Figure 4. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Algorithms** & \begin{tabular}{c} **Mean Absolute** \\ **Error** \\ \end{tabular} & \begin{tabular}{c} **Root Mean** \\ **Squared Error** \\ \end{tabular} & \
\begin{tabular}{c} **Relative Absolute** \\ **Error** \\ \end{tabular} &
\begin{tabular}{c} **Root Relative** \\ **Squared Error** \\ \end{tabular} \\ \hline Logistic Regression & 0.118 & 0.245 & 28.164 & 53.347 \\ MLP & 0.034 & 0.148 & 8.025 & 32.270 \\ Naive Bayes & 0.189 & 0.397 & 44.982 & 86.692 \\ Random Forest & 0.084 & 0.174 & 19.991 & 38.002 \\ SVM & 0.082 & 0.287 & 19.538 & 62.511 \\ Bagging & 0.097 & 0.204 & 23.120 & 44.573 \\ Bayes Network & 0.187 & 0.348 & 44.403 & 75.963 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: The Results of Errors Obtained from Classification to Diagnosis of Dementia (Phase 1). Multilayer Perceptron (MLP).