## 4 Methodology
### Ensemble Model Construction  
The ensemble classifier model within in the activity recognition framework is constructed by following a two-step procedure. The first step is to determine the diverse and accurate set of base classifiers by comparing the performance of various single classifiers on twelve activities classification. In this step, the extracted features are randomly selected to form the feature subspaces, using a small training dataset rather than all feature as input to the classifier can avoid overfitting problem and reduce the computation load. To construct the ensemble model, five commonly used classifiers: decision tree (DT), support vector machine (SVM), k-nearest neighbors (KNN), neural network (MLP) and naive Bayes (NB), are considered as ensemble members [42] These six classifiers are selected since they belong to different classifier types, which have different internal representations and biases. The different outputs of the base classifiers represent the extent to which they disagree about the probability distribution for the test data. This diversity would result in the disagreement with each other over the instances covering a range of feature space. The second step is to combine the base classifiers into the heterogeneous ensemble model by using combination functions. The combination functions make the best use of the information gained from the base classifiers for producing class labels predictions as accurate as possible. There are two general categories of combination functions: fusion function and selection function. Since the output of the \begin{table}
\begin{tabular}{l l l l} \hline
**Features Domain** & **Feature** & **Formulation** & **Values** \\ \hline \multirow{7}{*}{Time-domain feature} & Mean & \(\frac{1}{\Delta}\sum_{i=1}^{n}x_{i}^{2}\) & Body acceleration-\(x\), Body \\  & Root mean squared & \(\sqrt{\frac{1}{\Delta}\sum_{i=1}^{n}x_{i}^{2}}\) & acceleration-\(y\), Body acceleration-\(z\), \\  & Standard deviation & \(\sqrt{\frac{1}{\Delta}\sum_{i=1}^{n}(x_{i}-\overline{x})^{2}}\) & Body acceleration-\(\mathcal{M}\)V, \\  & Median absolute deviation & \(\text{median}\big{[}x_{i}-\text{median}(x_{i})\big{]}\) & Gravity acceleration-\(y\), \\  & Range & \(\text{max}_{i}(x)-\text{min}(x)\) & Gravity acceleration-\(\mathcal{M}\)V \\ \cline{2-4}  & Signal magnitude area & \(\frac{1}{\Delta}\sum_{i=1}^{n}\sum_{i=1}^{n}\lvert x_{i}\rvert\) & Body acceleration, Gravity acceleration-\(\mathcal{M}\)V, \\  & & & Gravity acceleration-\(\mathcal{M}\)V \\ \cline{2-4}  & & & Body acceleration-\(y\), \\  & Correlation coefficient & \(\text{cov}(x,y)/\varepsilon_{x}\sigma_{y}\) & Body acceleration-\(x\), \\  & & & Gravity acceleration-\(y\), \\  & & & Gravity acceleration-\(z\), \\  & & & Gravity acceleration-\(y\)-\(\sigma\) \\ \cline{2-4}  & & & Body acceleration-\(x\), Body acceleration-\(z\) \\ \hline \multirow{7}{*}{Frequency-domain feature} & Spectral energy & \(\frac{1}{\Delta}\sum_{i=1}^{n}x_{i}^{2}\) & \\  & Spectral entropy & \(\sum_{i=1}^{n}\left(c_{i}\log(c_{i})\right)\), \(c_{i}=s_{i}/\sum_{j=1}^{n}s_{j}\) & \\  & Skewness & \(\mathbb{E}\big{[}\big{(}\frac{x-\overline{x}}{x}\big{)}^{3}\big{]}\) & Body acceleration-\(y\), \\  & Kurtosis & \(\mathbb{E}\big{[}(x-\overline{x})^{4}\big{]}/\mathbb{E}[(x-\overline{x})^{2} \big{]}^{2}\) & Body acceleration-\(z\), \\  & Largest frequency component & \(\text{argmax}_{i}(x_{i})\) & Body acceleration-\(\mathcal{M}\)V \\  & Frequency signal & \(\sum_{i=1}^{n}\left(x_{i}\right)/\sum_{j=1}^{n}x_{j}\) & \\  & weighted average & & \\ \hline \end{tabular}
\end{table} 
Table 2: Features extracted from both time domain and frequency domain. selection function typically relies on the characteristic of data instance whose class is being predicted, which is not suitable in our work. We select majority voting function (defined as Equation (4)), which is a typical fusion function, to combine the outputs of base classifiers.