# Heart Diseases Diagnose via Mobile Application
## 3 Results  
From seven different machine learning techniques, a total of 25 different algorithms were tested with 15 features. PhysioNet dataset was separated into two, 70% for training and 30% for validation. All tests are conducted in MATLAB via the classification learner app. The detailed list of the tested algorithms is presented in Table 1.  
Classification accuracy performance and detailed classification metrics of the tested algorithms are presented in Appendix A (Tables A1-A7). Among experimented algorithms, the most successful one is an ensemble model of which its learner type is nearest neighbors, the number of learners is 30, and the subspace dimension is eighth. The sensitivity of the ensemble model which shows the power of detecting diseases is 83.7% and the specificity of the model which shows the power of detecting healthy individuals is 96% (Figure 5). As seen from Figure 5, the algorithm can guess healthy individuals at a very high success rate but miss 16% of unhealthy samples. As stated in the previous part, the classification algorithm has been trained and validated with the publicly available PhysioNet 2016 database. For verification purposes, we used the mobile application in real-life circumstances at Ankara City Hospital. The cardiac experts tested the algorithm and mobile application over 162 individuals who visited the clinic for regular check-ups. All participants were labeled both by the cardiologists and by the mobile application. According to cardiologists, 88 people were detected as healthy and 74 people were detected as unhealthy. The unhealthy individuals determined by the cardiologists were forwarded to further diagnostic tests. In these tests, it was confirmed that all unhealthy diagnosed individuals have heart abnormalities. Therefore, the auscultation diagnoses of cardiologists were accepted as the ground truth data. Detailed information about the Ankara City Hospital recordings is presented in Table 2. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Index**} & \multicolumn{8}{c}{**Algorithms**} \\ \cline{2-9}  & **LR** & **NB** & **DA** & **DT** & **SVM** & **KNN** & **Ensemble** \\ \hline
1 & Logistic & Gaussian & Linear & Fine & Linear & Fine & Boosted Tree \\
2 & & Kernel & Quadratic & Medium & Quadratic & Medium & Bagged Tree \\
3 & & & & Coarse & Cubic & Coarse & Subspace DC \\
4 & & & & & Fine & Cosine & Subspace KNN \\
5 & & & & & Medium & Cubic & RUSBoosted Tree \\
6 & & & & Coarse & Weighted & \\ \hline \hline \end{tabular}  
* LR = logistic regression, NB = naïve Bayes, DA = discriminant analysis, DT = decision tree, SVM = support vector machines, KNN = k-nearest neighbor.  
\end{table} 
Table 1: The algorithms used for tests. Figure 5: Detailed classification metrics of the ensemble model. The recordings used in the verification phase are collected by the developed mobile application. Those recordings are of vital importance since they represent the data quality expected in clinical practice. Verification results that are presented in Table 3 show that the mobile application can detect normal heart sounds above 92% specificity and 81% sensitivity which is very close to validation results in Appendix A (Tables A1-A7). This result shows the robustness of the developed classification algorithm since it can work properly on a mobile device. In verification tests, an Android tablet was used and the prediction result of the application was determined by the memory boosted diagnosis display (Figure 6). The memory display is prompted by a function that accumulates the last five diagnoses in a buffer and tries to catch the four or more same results. Within 25 s, the application generates five diagnostic outputs, if four or five consecutive diagnoses are received, the memorized decision of the algorithm is determined, and this result is accepted as the final decision of the application.