## 3 Data Analysis
### Feature Selection and Model Training  
In the context of our computational pipeline, feature selection techniques were applied to reveal the dominant features to be used for model training. We focus our analysis on identifying relations between the spatial and temporal gait features, the PD-related medication states, and disease severity levels. Specifically, we focused on four classification tasks. We initially focused on separating PD patients from non-PD patients in a binary classification problem. Non-PD patients are the elderly and adult subjects in our recordings. We then split the elderly and adults in a three-class classification problem, i.e., PD patients, elderly, and adult participants. The next classification problem focused on differentiating PD patients based on their medication state, the ON and OFF states. Finally, we focused on the MDS-UPDRS Part III ratings and the relevant PD severity levels, i.e., normal, mild, moderate, and severe, as described in detail in Section 2.4. However, our recordings include data from PD patients in only two severity levels, i.e., mild, and moderate. Although we did record a patient rated at the severe level, we had to exclude his recordings since he needed support to complete all of the tests and therefore this would induce bias.  
Feature-wise normalization was conducted prior to model fitting to address the possible issue of biased behavior, which result from uneven contribution of variables measured on different scales to the model-fitting and model-learned functions [58]. After extracting the gait data, we scaled each feature to a range of 0 to 1 using the MinMaxScaler function. In addition, we created a correlation matrix displaying the correlation coefficients between the variables as a preliminary data interpretation tool and as input for a more sophisticated investigation a Linear Mixed Model Analysis. The input data for each classification approach are the most significant features, selected among the 18 extracted gait temporal and spatial features based on the correlation matrix and the LMM analysis, presented in Section 4.1.  
Considering the relevant literature and the size and properties of our dataset, we selected three well-known and widely used classifiers to explore their performance. More specifically, AdaBoost (AB), Extra Trees (ET), and Random Forest (RF) classifiers were trained and tested during the classification procedure [59]. To fine-tune the hyperparameters of each classifier we performed a GridSearch iterating 1000 times through the training data, to find the combination of parameters that maximizes the overall performance and accuracy. Finally, we split the data into training and testing, with the number of the test data being 20% of the total number of examples, according to the Pareto principle [60]. We first train our model on the training set and then we use the data from the testing set to measure the accuracy of the resulting model. It is important to mention that we took into consideration that the test set is large enough to yield statistically meaningful results, and that it is representative of the dataset. We evaluated the models using the metric of accuracy. Furthermore, we validated the models using a k-fold cross-validation (k = 5). Choosing the right k-value is important as it can affect the level of accuracy, variance, and bias of a model. According to the literature [61], choosing a k-value of 5 or 10 has proven to provide a low bias and a modest variance. The larger the value of k becomes it becomes more computationally impractical, therefore in our work we chose k = 5 as more computationally efficient. The models were built using Python (3.8 Python packages, version numpy 1.17.2, sklearn 0.21.3, pandas 0.25.1).