# AI-Based Stroke Disease Prediction System Using Real-Time Electromyography Signals
## 4 Experiments and Analysis
### Experiment and Analysis Based on Machine Learning
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Methods Data Sets** & **Train (70)/ Test (30)** & **Train (80)/ Test (20)** & **5-Fold CV** & **10-Fold CV** & **20-Fold CV** \\ \hline C4.5 Decision Tree & 81.25 & 81.42 & 81.73 & 82.46 & 81.97 \\ C5.0 Decision Tree & 81.68 & 81.78 & 82.44 & 82.65 & 82.61 \\ Naive Bayes & 69.60 & 69.54 & 69.88 & 69.89 & 69.86 \\ Logistic Regression & 71.16 & 71.09 & 71.23 & 71.26 & 71.28 \\ (LR) & 77.98 & 77.94 & 78.56 & 78.78 & 78.79 \\ Random Forest (RF) & 85.38 & 85.44 & 85.70 & 85.86 & 85.84 \\ C\&RT & 79.89 & 79.86 & 79.95 & 80.16 & 80.12 \\ CHAID & 79.08 & 79.03 & 79.38 & 79.59 & 79.58 \\ Two-Class SVM & 73.33 & 73.31 & 73.63 & 74.07 & 73.72 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Prediction accuracy of stroke after quartile application (%). Next, the merit function (Equation (2)) was used to assess how efficiently each subset \(F_{s}\subset F\) expresses the overall attributes. The value of the merit function means that the subset with the largest value is the subset that best represents the entire attributes set [54]. \[\textit{Merit}(F_{s})=\frac{k\overline{r_{cf}}}{\sqrt{k+k(k-1)\overline{r_{ff}}}} \tag{2}\]  
where \(k\) is the number of attributes in subset \(F_{s}\), \(\overline{r_{cf}}\) is the mean distribution of attributes contained in \(F_{s}\), and \(\overline{r_{ff}}\) is the mean correlation value of the attributes. The 20 attributes for the subset that were finally selected through CFS are as follows, listed in order of importance: BFL_PositivePeak, BFL_NegativePeak, BFL_5 PPISD, BFL_10 PPISD, BFR_Mmax, BFR_PositivePeak, BFR_NegativePeak, LGL_Mmax, LGL_PositivePeak, LGL_NegativePeak, LGL_5_PPIIMean, LGL_5 PPISD, LGL_10 PPISD, LGR_Mmax, LGR_PositivePeak, LGR_NegativePeak, LGR_5 PPIIMean, LGR_10 PPIIMean, and LGR_10 PPISD. The prediction accuracy of stroke when using only 20 attributes with CFS is improved by more than 1% when compared to the prediction using all 28 attributes. For disease prediction, an accuracy improvement of more than 1% has great significance. We showed that by using the CFS method, only key attributes need to be selected and utilized, and the prediction accuracy can still be improved. This reduces the time needed for classification and maximizes the efficient use of system resources. In the fourth experiment, 20 attributes were finally selected by applying quartiles and attribute subsets (CFS) to the original data, and then Z-score normalization was performed for each attribute as shown in Equation (3) (see Table 5). This normalization process converts the data to a small range, such as from 0.0 to 1.0, so that the same weight can be applied to all attributes. For example, the minimum and the maximum values of the BFL_PositivePeak vary in size and are subject to measurement units, and therefore need to be avoided. In Equation (3), \(\sigma\) and \(\mu\) are the standard deviation and mean of attribute \(x\), respectively, and \(\alpha\) is set as the weighted value, which was 1.0 in the experiment. \[\vec{x_{i}}=\frac{x_{i}-\mu}{\sigma}\times\alpha \tag{3}\]  
The result showed that the Random Forest algorithm had high prediction accuracies of 90.25% and 90.38% at 10-fold CV and 20-fold CV, respectively. Since the Random Forest algorithm is an ensemble method that involves learning from several decision trees, it overcame the disadvantage of a large variation in the performance of the decision tree and ultimately showed good accuracy. Furthermore, some machine learning methodology only places importance on the prediction accuracy of the disease and may overlook the machine interpretation of the operating principles of the system. These core operating principles are like black boxes that allow for limited semantic analysis based on medical or clinical data. For this reason, it is a desirable approach to make predictions through a Random Forest algorithm.