## 3 Materials and Methods
### Adapted BPSO Algorithm for Feature Selection in the Case of DLAs Sensors Data
Each of those sensors is equipped with a triaxial accelerometer (three features) and a triaxial gyroscope (three features). The accelerometer measures the proper acceleration while the gyroscope measures the velocity and the angular velocity. The sensors were placed on the left ankle, on the right hip, on the chest and on the right ankle of the monitored subjects. The frequency of sampling of those sensors is 200 Hz. Figure 2 summarizes the number of samples of each daily living activity for each monitored subject. As can be seen in the figure, the walking outside activity (\(DLA_{7}\)) contains the biggest number of samples for each monitored subject and moreover the samples for each activity are not balanced. #### 4.1.2 Feature Selection

In this step, various combinations of feature selection techniques are investigated. Four different types of feature selection techniques are applied:

Figure 1: Sensors positions for the Daily Life Activities (DaLiAc) dataset: (**1**) chest (C), (**2**) right wrist (RW), (**3**) left ankle (LA), (**4**) right hip (RH). 1. The first technique considers the features that correspond to the monitoring sensors that are used for collecting the data from the monitoring sensors: six features (chest sensor), six features (right wrist sensor), six features (left ankle sensor), six features (right hip sensor);
2. The second technique considers the following three feature selection algorithms from literature: the forward feature selection (FFS) algorithm [38], the backward features elimination (BFE) algorithm [39] and the random forest (RF) [40];
3. The third technique considers the BPSO algorithm adapted for data generated by monitoring sensors placed on the bodies of the monitored subjects;
4. The fourth technique considers adapted versions of genetic algorithm (GA) [41] and differential evolution (DE) [42] for feature selection using the same objective function as in the case of the adapted BPSO algorithm;

#### 4.1.3 Cross Validation

The approach presented in this article is based on 10-fold cross validation. Thus, the data is split randomly in 10 folds of approximately equal size and the prediction model is run 10 times, such that, in each run, the testing data is represented by a different fold from those 10 folds and the training data is represented by the remaining nine folds. #### 4.1.4 Machine Learning Classification Model

The machine learning classification model is used in the classification of the daily living activities performed by the monitored subjects based on the data from the monitoring sensors. The machine learning classification model that is applied in this article is RF. RF is an ensemble classification approach that is based on the development of a collection of decision trees and has applications in many domains, such as medicine, ecology, bioinformatics, astronomy, and agriculture, and, moreover, it is a very good option for imbalanced datasets. #### 4.1.5 DLAs Classification

The final output of the machine learning methodology is represented by the classified DLAs, considering the raw sensors data generated during the monitoring of the DLAs. The metrics that

Figure 2: Distribution of DLAs samples for each monitored subject of the DaLiAc dataset. are applied in the evaluation of the models used for the classification of the DLAs are the recall, the precision, and the F-measure. Feature Selection Results for DLAs Data Generated by Monitoring Sensors Using the Adapted BPSO Algorithm

The configuration of the parameters of the adapted BPSO algorithm applied in the experiments is summarized in Table 2.

The mappings between the sensor particles weights and the sensor positions for the DaLiAc dataset are: \(t_{1}\)--C, \(t_{2}\)--RW, \(t_{3}\)--LA and \(t_{4}\)--RH. Table 3 summarizes the weights of the sensor particles for the DaLiAc Dataset, for each monitored subject.