## Materials and Methods
### Classification  
The Support Vector Machine (SVM) classification method, a powerful method that has been widely used in many areas, including human-motion and gait-pattern classification, was used in this study [12; 26; 27; 28; 29; 30; 31]. This geometry-based classifier produces the largest margin between two classes by constructing boundaries that separate all data points of one class from the other class. In this study, the aim of the SVM classification was to find Optimal Separation Hyperplane (OSH) between healthy and stroke patients groups. SVM  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Feature No.** & **Name** & **Abbreviation** \\ \hline
1–3 & Acceleration SD on 1 stride gait cycle & SD ACC V/AP/ML \\
4–6 & Acceleration Skewness on 1 stride gait cycle & Skew ACC V/AP/ML \\
7–9 & Acceleration Kurtosis on 1 stride gait cycle & Kurt ACC V/AP/ML \\
10–12 & Acceleration RMS on 1 stride gait cycle & RMS ACC V/AP/ML \\
13–15 & Peak-to-peak angular velocity on 1 stride gait cycle & P2P Gyro V/AP/ML \\
16–18 & Acceleration first dominant frequency & FD Freq V/AP/ML \\
19–21 & Acceleration band power on 3 dB bandwidth & Power 3 dB V/AP/ML \\
22–24 & Acceleration bandwidth frequency on 3 dB bandwidth & BW 3 dB V/AP/ML \\
25–27 & Acceleration lower bounds frequency on 3 dB bandwidth & Flo 3 dB V/AP/ML \\
28–30 & Acceleration upper bounds frequency on 3 dB bandwidth & Fri 3 dB V/AP/ML \\
31–33 & Acceleration band power on 99\% occupied bandwidth & Power all V/AP/ML \\
34–36 & Acceleration bandwidth frequency on 99\% occupied bandwidth & BW all V/AP/ML \\
37–39 & Acceleration lower bounds frequency on 99\% occupied bandwidth & Flo all V/AP/ML \\
40–42 & Acceleration upper bounds frequency on 99\% occupied bandwidth & Fri all V/AP/ML \\ \hline \hline \end{tabular}
\end{table}
Table 1: Features number, name, and abbreviation.  
finds the OSH margin by maximizing the distance between class. That can happen by transforming the input data into a higher dimensional space by calculating the means of a kernel function. Then, the separation hyperplane can be constructed between the 2 classes in the transformed space [32].  
Training datasets from selected features were used to train four SVM kernels (linear, Gaussian, quadratic, and cubic), by employing the Classification Learner toolbox in MATLAB [33]. From all 23 subjects, 18 subjects (9 from healthy group and 9 from stroke group) were used for training and validation purpose; meanwhile, the others 5 subjects (2 from healthy group and 3 from stroke group) served as the unseen testing dataset. Since each of subjects completed 6 trials of the level walking task, there was a total of 30 testing datasets (12 datasets from normal group and 18 datasets from stroke group). Tenfold cross-validation was performed to validate the models [12]; then, the final trained model was tested on the unseen 30 testing dataset, as explained before.  
The performance of the SVM classifier was validated by using the following three metrics [26; 34]:  
\[Accuracy=\ \frac{TP+TN}{TP+FP+TN+FN}\ \times 100\% \tag{2}\]  
\[Sensitivity=\frac{TP}{TP+FN}\times 100\% \tag{3}\]  
\[Specificity=\ \frac{TN}{FP+TN}\ \times 100\% \tag{4}\]  
where _TP_ and _TN_ are the number of true positives and true negatives, respectively. _FP_ and _FN_ are the number of false positives and number of false negatives, respectively. In this study, _TP_ was defined as the classifier correctly identifying a stroke gait, and _TN_ was defined as the classifier correctly identifying a normal gait.  
The classifier accuracy indicates the overall detection accuracy. _Sensitivity_ refers to the accuracy of the classifier in recognizing the stroke gait condition. _Specificity_ is defined as the ability of the classifier to avoid false detection of normal gaits [26]. The summary of the methodology is shown in Figure 2.