## 3 Results
### Performance of k-Fold and LOSO Methods Across Models  
Figure 5 shows the training and testing accuracies of all four models validated on eight-fold and LOSO CV. Both validation methods achieved relatively equal training accuracies across all four models, with random forest achieving the highest result of 97%. In testing, expectedly, LOSO achieved lower accuracies than k-fold in all models. This can be deduced to be caused by the variability in how the different subjects performed the activities, which the LOSO models were less effective in differentiating, especially when closely tied to individual users. In analyzing the performance of k-fold and LOSO on the random forest, Table 2 provides a classification report for k-fold in each of the eight folds, and Table 3 is a classification report for LOSO in each subject-specific test instance. For subject 8, the model was trained on subjects 1-7 and evaluated on 8. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Accuracy** & **Precision** & **Recall** & **Model** \\ \hline
0 & 0.890995 & 0.901599 & 0.893519 & random forest \\
1 & 0.890338 & 0.911733 & 0.892361 & random forest \\
2 & 0.895080 & 0.914623 & 0.896021 & random forest \\
3 & 0.873740 & 0.899322 & 0.875867 & random forest \\
4 & 0.882039 & 0.890860 & 0.886018 & random forest \\
5 & 0.880261 & 0.897396 & 0.877654 & random forest \\
6 & 0.889152 & 0.909028 & 0.891709 & random forest \\
7 & 0.882632 & 0.907564 & 0.885401 & random forest \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Classification report of random forest on each fold of k-fold. Figure 5: Plot of all models’ training vs. testing accuracies for k-fold and LOSO. As observed based on the performances, there is a huge variation in accuracy amongst the subjects in LOSO compared to k-fold, where the variation is negligible. This highlights the capacity of LOSO to capture variability among subjects. Tables 4 and 5 are classification reports of k-fold and LOSO. k-fold generally achieved higher, precision which means it correctly classified the activities better than LOSO. This lower LOSO classification can be explained as differences among subjects in the training and testing datasets. In analyzing specific activities, LOSO achieved 0% across all metrics for class 7, Nordic walking. This means it could not predict a single correct instance. This was caused by the low support value of 59 for this class, meaning that a substantial number of instances for this class was not available and was not represented in each training instance, leading to poor model generalization. K-fold, however, achieved 98% accuracy for the same class \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Precision** & **Recall** & **F1 Score** & **Support** \\ \hline
1 & 0.89 & 0.72 & 0.79 & 1893 \\
2 & 0.69 & 0.76 & 0.73 & 1819 \\
3 & 0.77 & 0.78 & 0.77 & 1868 \\
4 & 0.89 & 0.73 & 0.80 & 1629 \\
7 & 0.00 & 0.00 & 0.00 & 59 \\
12 & 0.57 & 0.64 & 0.60 & 1138 \\
13 & 0.75 & 0.56 & 0.64 & 1017 \\
16 & 0.79 & 0.83 & 0.81 & 1721 \\
17 & 0.73 & 0.90 & 0.80 & 2353 \\ \hline accuracy & & & 0.76 & 13,497 \\ macro avg & 0.68 & 0.66 & 0.66 & 13,497 \\ weighted avg & 0.76 & 0.76 & 0.76 & 13,497 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Classification report of k-fold on random forest. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Model** & **Subject** & **Accuracy** & **Precision** & **Recall** & **F1-Score** \\ \hline  & 1 & 0.684866 & 0.693740 & 0.684866 & 0.667359 \\  & 2 & 0.812204 & 0.825516 & 0.812204 & 0.808839 \\  & 3 & 0.770006 & 0.785704 & 0.770006 & 0.759448 \\ Rf\_model & 4 & 0.755187 & 0.784565 & 0.755187 & 0.753585 \\  & 5 & 0.623815 & 0.579001 & 0.623815 & 0.583957 \\  & 6 & 0.772970 & 0.780498 & 0.772970 & 0.768426 \\  & 7 & 0.783175 & 0.810397 & 0.783175 & 0.784631 \\  & 8 & 0.852401 & 0.862090 & 0.852401 & 0.854501 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Classification report of random forest on each subject on LOSO.