# The Influence of Motion Data Low-Pass Filtering Methods in Machine-Learning Models
## 2 Materials and Methods
### Machine-Learning Models  
Model selection: As the gait patterns were significantly different across the three types of trials (regular gait, gait-slip and gait-trip), we developed classification models to automatically identify the trial type based on gait data. Three widely used classifiers with different complexity were employed in this study, which are Logistic Regression (LR), Support Vector Classification (SVC), and Random Forest Classification (RFC). LR models have low complexity, SVC models have medium complexity, and RFC models have high complexity. These methods are widely used for gait analysis, such as gait abnormality detection, gait independent prediction, and gait event detection [19; 24; 25; 26]. LR was chosen for its simplicity and interpretability for simple, linearly separable problems. SVC was included due to its ability to handle moderately complex, non-linear decision boundaries using kernel functions and it offers a balance between complexity and flexibility. RFC was selected for its robustness in handling high-dimensional, non-linear problems and its ability to model complex interactions between features. RFC is well-suited for complex problems with large datasets and when overfitting is a concern. Other ML models, such as neural networks or gradient-boosting methods were excluded due to their higher computational complexity and potential overfitting risk given the relatively small dataset size.  
Feature selection: We selected features using the ReliefF algorithm, which ranks features based on their relevance to the target variable [27]. The top 50% (\(n=4\)) of features comprised the step length and thigh, shank, and foot angles, and they were selected to minimize redundancy and focus on the most informative features. To minimize the effect of the number of features on the model performance, all 15 combinations [C(4,1) + C(4,2) + C(4,3) + C(4,4) = 15] of these 4 features were used for model training, and the average performance across these 15 combinations for each model were calculated. This approach ensured that the models were not biased by specific feature subsets, and the average performance across combinations provided a robust assessment of each model's capability.  
Model training: The whole dataset was split into a training set (80%) and a test set (20%) using a stratified 5-fold cross-validator. The models were trained using the training set and validated using the test set. As only single trials for each type (one regular gait, one slip, and one trip) for each participant were included, the same type of trial from the same participant was not present in both the training and testing sets. Given that the gait patterns are significantly different across trial types (regular gait, gait-slip, and gait-trip), the models are trained to classify these distinct patterns rather than participant-specific characteristics. This setup minimized the risk of data leakage because the training and testing sets are inherently independent with respect to both trial type and participant.  
Each model was trained with a different combination of features (\(n=15\)), and the features were filtered by different filters (\(n=27\)); hence, a total of 1215 (3 classifier \(\times\) 15 combination \(\times\) 27 filter method) models were trained in this study. The default hyperparameters provided by the Scikit-learn library were used for all models without additional tuning.  
Model evaluation: To evaluate the performance of each model, the receiver operating characteristic curve (ROC) for balance outcomes was first calculated. Next, the overall classification accuracy and area under the curve (AUC) were calculated for each model at the default cutoff (0.5) using the equation. AUC is a robust metric of a model's performance.  
Hence, the AUC of each model was also calculated for each test set (\(n\) = 5-fold), and the average AUC of 5 test sets was used to represent the performance of each model.