## 2 Data Collection
### Model Selection and Algorithm Design
This study used tuning to test the number of trees, the minimum number of data points in a node that were required for the node to be split further, and the number of predictors that was randomly sampled at each split when creating the tree models. Compared to Random Forest, XGBoost uses gradient boosting with regularization, i.e., the algorithm uses decision tree ensemble but optimizes performance by redefining boosting with the objective to minimize losses by adding weak learners using gradient descent [48]. The results of testing with KNN, Random Forest, and XGBoost are presented and analyzed (e.g., Table 3). \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline
**Algorithm** & **Accuracy Score (\%)** & **Weighted Average (\%)** & **Model Training Time** \\ \hline KNN & 84 & 83 & 0.39 s at K = 12 \\ \hline Random Forest & 86 & 86 & 13.98 s, 800 estimators, and max depth = 8 \\ \hline XGBoost & 75 & 74 & 170.98 s (n\_estimators = 2, max\_depth = 2, learning\_rate = 1, objective = ’multiplied’: softprob’, num\_round = 25) \\ \hline \end{tabular}
\end{table} 
Table 3: Performance summary of KNN, Random Forest, and XGBoost. Data Splitting, Hyperparameter Tuning, and Optimizing  
At the initial stage, the data were split, with 70% allocated for testing and 30% for training. The stratified splitting technique was applied to ensure the same frequency distribution of the outcome in the analysis and assessment sets. Cross-validation was implemented with 5k folds and later confirmed with 10k folds and 5 repeats, where the data were split into 10 parts with different random shuffles of the data each time. Since every part is used as the test set only once, this provides more stable and reliable estimates of model performance because it averages the results over more splits/shuffles of the data. Additionally, this approach was used to provide a better bias-variance trade-off. Input variables were normalized (Table 2) using RobustScaler. Using this approach, the data were transformed by removing the median and scaling according to the quantile range (i.e., between the 25 th and 75 th quantiles). Such an approach ensured robustness to outliers and non-reliance on distributional assumptions, which were particularly important for employed ML algorithms (e.g., KNN). GridSearch cross-validation was used to determine the optimal list of parameters for machine learning models. The overfitting concerns were addressed by repeating the grid search via racing with ANOVA models [62]. Such racing methods in combination with parallel processing have shown faster performance compared to sequential grid search approaches. Fitting 5 folds and iterating for 28 candidates, totaling 140 fits, the best parameters for KNN were tested with 7 neighbors, 2 distances, 2 weights, and 5 cross-validations, and the best parameters proposed were (['n_neighbors': 13, 'p': 2, 'weights': 'distance']). Similarly, Random Forest's best parameter suggestion with GridSearch was (['criterion': 'gini','max_depth': 8,'max_features':'sqrt', 'n_estimators': 400, 'random_state': 42)). Feature importance using permutation analysis was completed for the developed models and presented graphically. The importance of a feature was measured by calculating the increase in the model's prediction error after permuting the feature. The importance was defined if the shuffling feature's values increased the model error [63]. The feature variables (accelerometer and angular velocity) were separately investigated to determine individual contributions to the prediction of the MFC heights. The results are shown in Table 4a,b.