## 3 Materials and Methods
### Adapted BPSO Algorithm for Feature Selection in the Case of DLAs Sensors Data
Next, for each particle from the swarm (lines 17-30) and for each dimension of the particle (lines 18-29) the new value of the velocity of the particle for dimension \(d\) is computed, taking into consideration the following components:

* the inertia component: \(w\times v_{d}^{old}\),
* the cognitive component: \(c_{1}\times r_{1}\times(p_{best,d}-x_{d}^{old})\),
* the social component: \(c_{2}\times r_{2}\times(g_{best,d}-x_{d}^{old})\),
* the sensors component: \(\sum_{k=1}^{N_{sensors}}t_{k}\times r_{k+2}\times(s_{k,d}-x_{d}^{old})\). If the computed value is not in the interval \((V_{min},V_{max})\), then that value is updated either to \(V_{min}\) or to \(V_{max}\) (lines 20-22) as follows:\[v_{d}^{new}=\left\{ \begin{array}{ll}V_{min}&\text{if }v_{d}^{new}<V_{min}\\ V_{max}&\text{if }v_{d}^{new}>V_{max}.\end{array} \right. \tag{10}\]

The velocity is converted into a probability value (line 23) using the exponential:

\[S(v_{d}^{new})=\frac{1}{1+e^{-v_{d}^{new}}}. \tag{11}\]

In (lines 24-28) the value of a random value \(r_{0}\) from \([0,1]\) is applied in order to update the position of the particle as follows:

\[x_{d}^{new}=\left\{ \begin{array}{ll}1&\text{if }r_{0}<S(v_{d}^{new})\\ 0&\text{otherwise}.\end{array} \right. \tag{12}\]

In (line 31) the current iteration \(i\) is incremented with 1 and finally in (line 33) the algorithm returns the value of \(g_{best}\). ## 4 Results

The adapted version of the BPSO algorithm was written and evaluated in Java in Intellij IDEA. The feature selection experiments for the adapted BPSO algorithm were performed in Intellij IDEA. The experiments for feature selection using FFS and BFE were performed in Konstanz Information Miner (KNIME) [37]. The experiments for feature selection using RF were performed in JetBrains PyCharm, using the sklearn library from Python. The experiments for feature selection based on the adapted versions of GA and DE were performed in Intellij IDEA. The properties of the system in which the experiments were performed are:

1. processor properties: Intel(R) Core(TM) i5-7600K CPU @ 3.80 GHz 3.80 GHz;
2. installed memory (RAM) properties: 16.0 GB;
3. system type properties: 64-bit Operating System, x64-based processor. ### Machine Learning Methodology for the Classification of DLAs Based on Adapted BPSO

The steps of the machine learning methodology that is applied in the classification of the DLAs using data generated by monitoring sensors are described in more details in the next subsections. In the _Feature Selection_ step, the methodology integrates the algorithm that is presented in this article, namely the adapted BPSO algorithm. The methodology is also used as support in order to validate and to test this algorithm. #### 4.1.1 DLAs Sensors Data

In Figure 1, the placement of the monitoring sensors for the DaLiAc dataset is illustrated. The main characteristics of the DaLiAc dataset are presented in Table 1. \begin{table}
\begin{tabular}{c c} \hline \hline
**Characteristic** & **Value** \\ \hline number of daily living activities (DLAs) & 13 \\ number of subjects & 19 \\ number of monitoring sensors & 4 \\ total number of features & 24 \\ sampling frequency & 200 Hz \\ \hline \hline \end{tabular}
\end{table} 
Table 1: DaLiAc dataset characteristics. In the case of the DaLiAc dataset the following activities are monitored:

1. \(DLA_{1}\)--Sitting;
2. \(DLA_{2}\)--Lying;
3. \(DLA_{3}\)--Standing;
4. \(DLA_{4}\)--Washing dishes;
5. \(DLA_{5}\)--Vacuuming;
6. \(DLA_{6}\)--Sweeping;
7. \(DLA_{7}\)--Walking outside;
8. \(DLA_{8}\)--Asceending stairs;
9. \(DLA_{9}\)--Descending stairs;
10. \(DLA_{10}\)--Treadmill running;
11. \(DLA_{11}\)--Bicycling (50 outt);
12. \(DLA_{12}\)--Bicycling (100 watt);
13. \(DLA_{13}\)--Rope jumping;

The DaLiAc dataset contains information about 19 subjects (eight females and eleven males) aged \(26\pm 8\) years. The data was acquired using four SHIMMER (Shimmer Research, Dublin, Ireland) sensors.