## 2 Materials and Methods
### Explainable AI  
The quest for transparent and human-interpretable ML models has led to the development of several techniques, which are generally referred to as Explainable Artificial Intelligence (XAI). These techniques also opened the possibility of evaluating the contribution of individual input features to a model's predictions, thus increasing the interpretability of the model output. Unlike classical feature selection methods, which are used before model training to identify the most predictive input variables, XAI methods are applied post hoc to assess feature contributions after model training, reflecting how the trained model uses the input features to make the prediction. This opens to the identification of context-specific effects, feature interactions, potential biases, or clinically relevant patterns. In this work, we applied these methods to enlighten the most relevant gait parameters using model-agnostic XAI methods. In this way, despite the different nature of the classifiers employed, the importance of the gait parameters can be compared.  
In this regard, we applied permutation importance [15] and SHAP [16] for all the classifiers. Permutation importance is considered one of the global XAI methods. The permutation importance estimates the relevance of a feature by evaluating the change of a reference metric (e.g., the accuracy) of the classifier when the feature values are replaced with shuffled ones. A high score indicates that the shuffling of the feature values has a great impact on the classification, and vice versa, a negative score indicates that the performance of the classifier increased when the feature values were shuffled, meaning that the feature was not relevant for classification. In this work, we used the permutation_importance function of scikit-learn, with classification accuracy as the scoring metric. This method was applied to the model's predictions on the test set, allowing us to evaluate the most relevant features for classifying previously unseen data.  
SHAP [16] is a local, model-agnostic explanation method based on Shapley values computation, which uses only the input and output of a classifier. It is a game-theoretic approach that returns a value for each feature and for each prediction made by a classifier. The importance of each feature is based on averaging its marginal contribution to the classifier output conditioned on all possible subsets of other features. This method is not related to the correctness of the prediction; however, it can detect even a small contribution a feature has in the internal decision making of a classifier, even if its removal has no significant effect on the reference metric--differently from permutation importance, which estimates the impact of a feature on model performance [29]. As for the permutation importance, we computed the so-called SHAP values for each feature based on the model's predictions on the test set (i.e., an array of dimension \(N_{feature}\times N_{data}\)). For each fold, we then took the absolute SHAP values and averaged them across data points, obtaining a single importance value for each feature (i.e., an array of dimension \(N_{feature}\)). For tree-based models, a specific version of the SHAP explainer function was used, i.e., the TreeExplainer [30].  
We computed the Shapley values only for the binary classification tasks. In fact, when a multi-class problem is studied with SHAP, the method returns, for each gait parameter, an array of size \(N_{\text{classes}}\), with the Shapley value derived by treating the output for each class as the result of a binary classification (in a One-vs-Rest fashion). Moreover, SHAP values can change significantly among the classifiers. To better compare the values obtained for different classifiers, we first computed the average of the absolute SHAP values for every classification task and then normalized this quantity.