## 2 Data Collection
### Model Selection and Algorithm Design  
As shown in Figure 3, the dataset features are non-linearly separable, and characteristic attributes of each data point form a category that is assigned to a class. To address this classification task, this study used K-Nearest Neighbor (KNN), Random Forest, and XGBoost supervised machine learning methods. These methods have proven success in several use cases in gait classification and identification [54; 55]. Additionally, given the focus of this study, all three methods were sourced from prior studies, where these algorithms were used with IMU-sourced data, particularly using KNN (e.g., [56; 57]), Random Forest (e.g., [58]), and XGBoost (e.g., [59]). The choice of classification approaches was supported by [60], where KNN and RF were identified among the top-performing algorithms for classification of human motion data using IMUs. Further consideration of the selection was the characteristics of the data used in this study, namely assumptions about data distribution, robustness to non-linear relationships, and the potential to leverage multiple algorithms and yield better performance while maintaining some interpretability with further applications [61]. The selection of these classical machine learning algorithms also allowed benchmarking with similar studies, where Random Forest and boosting approaches (such as XGBoost) were shown to achieve higher classification accuracy in similar settings [58; 59]. Figure 3: Pair plot correlation of the feature variables (linear acceleration and angular velocity) on the target R1 (blue), R2 (orange), and R3 (green). Acc = linear acceleration; Gyro = angular velocity; x, y, z = three dimensions and rotational axes. Using KNN, Random Forest, and XGBoost allowed us to leverage the stronger points of each of the algorithms. Compared to Random Forest and XGBoost, K-Nearest Neighbor (KNN) uses distance measures (e.g., Euclidean distance function) between every two data points to classify the points to find K-Nearest Neighbor. Given the relatively small number of features in the model, training time for KNN was not a concern, while XGBoost was expected to perform well with low-variance features. Comparing the performance of KNN to Random Forest and XGBoost would allow us to avoid overfitting concerns as well as leverage KNN results for their interpretability. KNN is one of the main supervised learning algorithms with a relatively simple structure that can be used in both classification and regression tasks. In KNN, each instance is categorized as a vector of numbers in an n-dimensional Euclidean space. To find the class to which an unknown data point is a neighbor, the Euclidean distance was measured. All instances, therefore, correspond to points in an n-dimensional Euclidian space, and the distance between instances \(d\)(\(p\),\(q\)) is as follows:  
\[d(p,q)=\sqrt{\left(q_{1}-p_{1}\right)^{2}+\left(q_{2}-p_{2} \right)^{2}+\ldots+\left(q_{n}-p_{n}\right)^{2}}\] \[=\sqrt{\sum\limits_{i=1}^{n}\left(q_{i}-p_{i}\right)^{2}}\]  
Given K-Nearest Neighbor, the optimum value is picked for the best prediction of either the R1, R2, or R3 MFC height category. On the other hand, Random Forest and XGBoost algorithms offer a different approach by using ensemble learning for supervised machine learning tasks. In Random Forest, an ensemble of many decision trees is designed to overcome overfitting problems associated with decision trees by bootstrap aggregation or bagging. Given a Random Forest tree \(T_{b}\) (_for \(b=1\) to \(B\)_) to the bootstrap sample \(Z^{\bullet}\) of size \(N\) from training data, a prediction at a new point \(x\) is made using the following classification:  
\[C_{rf}^{B}(x)=\text{majority vote}\ \{\hat{C}_{b}\left(x\right)\}_{1}^{B}\]  
where  
\(\hat{C_{b}}(x)\) is the class of prediction of the \(b\)th Random Forest. This study used the Gini impurity as a measure to quantify the purity of a node in a decision tree.