# Feature Optimization for Gait Phase Estimation with a Genetic Algorithm and Bayesian Optimization
## 4 Results
### Error Reduction Due to Optimization  
During the optimization procedure, the error value decreased and converged for all subjects, as shown in Figure 7. The final optimization results for walking and running are presented in Tables 6 and 7, respectively. The shaded boxes indicate that the corresponding feature was not included in the best feature set. While the initial angle \(\theta(t_{i})\) and angular velocity \(\dot{\theta}(t_{i})\) depend on the LTW, the final angle \(\theta\Big{(}t_{f}\Big{)}\) and angular velocity \(\dot{\theta}\Big{(}t_{f}\Big{)}\) are independent of the LTW. Thus, no LTW values are provided for \(\theta\Big{(}t_{f}\Big{)}\) and \(\dot{\theta}\Big{(}t_{f}\Big{)}\). To assess the error reduction for walking, the error for feature set 1 is also provided in Table 6 (see the numbers in parentheses in the last row). For walking, when the error is averaged over all subjects, the average error is 0.910% after optimization. This subject-average error is 1.284% when feature set 1 is used. For running, the error for feature set 2 is provided in Table 7 (see the numbers in parentheses in the last row). The average error is 1.997% for feature set 2. The error decreased to 1.484% when using the proposed approach. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Walking**} & \multicolumn{5}{c}{**Subject ID**} & \multirow{2}{*}{**Average**} \\ \cline{2-2} \cline{4-6}  & **1** & **2** & **3** & **4** & **5** & \\ \hline Feature set 1 & 1.488\% & 1.206\% & 1.301\% & 1.408\% & 1.228\% & \\  & (0.083) & (0.078) & (0.078) & (0.099) & (0.035) & 1.326 \\ Feature set 2 & 1.225\% & 1.388\% & 1.151\% & 1.385\% & 1.45\% & \\  & (0.059) & (0.079) & (0.078) & (0.016) & (0.046) & 1.321 \\ Feature set 3 & 2.150\% & 2.000\% & 2.047\% & 2.075\% & 2.256\% & \\  & (0.344) & (0.198) & (0.283) & (0.463) & (0.164) & 2.106 \\ Feature set 4 & 1.624\% & 1.524\% & 1.553\% & 1.583\% & 1.681\% & \\  & (0.067) & (0.105) & (0.078) & (0.072) & (0.145) & 1.593 \\ Feature set 5 & 1.264\% & 1.258\% & 1.297\% & 1.458\% & 1.238\% & \\  & (0.071) & (0.078) & (0.055) & (0.045) & (0.039) & 1.303 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Mean estimation error of heuristic feature sets for walking (No optimization). The numbers in parenthesis represent the standard deviation. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Running**} & \multicolumn{5}{c}{**Subject ID**} & \multirow{2}{*}{**Average**} \\ \cline{2-2} \cline{4-6}  & **1** & **2** & **3** & **4** & **5** & \\ \hline Feature set 1 & 2.250\% & 1.919\% & 2.678\% & 1.687\% & 2.113\% & \\  & (0.113) & (0.102) & (0.082) & (0.117) & (0.106) & 2.129 \\ Feature set 2 & 2.254\% & 2.085\% & 2.545\% & 1.503\% & 1.493\% & \\  & (0.060) & (0.052) & (0.033) & (0.093) & (0.096) & 1.976 \\ Feature set 3 & 2.539\% & 2.554\% & 2.904\% & 1.556\% & 2.064\% & \\  & (0.124) & (0.079) & (0.104) & (0.115) & (0.278) & 2.323 \\ Feature set 4 & 2.317\% & 2.207\% &  
Additional case study is provided in Tables S1 and S2 in Supplementary Materials, which suggests the importance of feature selection on the estimation accuracy. It is worth noting that the optimal LTW is considerably different between some subjects. This difference is caused by the local minima of error over LTW. Details are provided in Figure S2 in Supplementary Materials.