## 3 Dataset Evaluation  
We organized the accelerometer samples in order to evaluate four classification tasks:  
1. _AF-17_ contains 17 classes obtained by grouping all the 9 classes of ADLs and 8 classes of FALLs. This subset permits to evaluate the capability of the classifier to distinguish among different types of ADLs and FALLs;
2. _AF-2_ contains 2 classes obtained by considering all the ADLs as one class and all the FALLs as one class. This subset permits to evaluate, whatever is the type of ADL or FALL, the classifier robustness in distinguishing between ADLs and FALLs;
3. _A-9_ contains 9 classes obtained by considering all the 9 classes of ADLs. This subset permits to evaluate how much the classifier is capable to distinguish among different types of ADLs;
4. _F-8_ contains 8 classes obtained by considering all the 8 classes of FALLs. This subset permits to evaluate how much the classifier is capable to distinguish among different types of FALLs.  
We initially evaluated the classifiers by performing a traditional _5-fold_ cross-validation. This means that all the data have been randomly split into 5 folds. Each fold has been considered as test data and the remaining ones as training data. Results are computed by averaging the result obtained on each test fold. The folds have been obtained by applying the stratified random sampling that ensures samples of the same subject in both the test and the training folds. We refer to this evaluation also as _subject-dependent_.  
To make the dataset evaluation independent from the effect of personalization, we conducted another evaluation by performing a _leave-one-subject-out_ cross-validation. Each test fold is made of accelerometer samples of one user only, namely the _test user_, while the training folds contain accelerometer samples of all the other users except the samples of the _test user_. We refer to this evaluation also as _subject-independent_.  
Previous studies have explored a wide range of feature vector representations for acceleration signals. Some examples are [48; 54; 55]: raw data, magnitude of the signal, frequency-domain features, signal moments, cepstral frequency, and other heuristic features.  
Here we considered two feature vectors:  
1. raw data: the 453-dimensional patterns obtained by concatenating the 151 acceleration values recorded along each Cartesian direction;
2. magnitude of the accelerometer signal, that is a feature vector of 151 values. We experimented with four different classifiers:  
1. k-Nearest Neighbour (k-NN) with \(k=1\);  
Figure 4: Activity samples distribution.  
Support Vector Machines (SVM) with a radial basis kernel;
* Artificial Neural Networks (ANN). We set up a three-layers feed forward network with back propagation. The network architecture includes an input layer, a layer of hidden neurons and an output layer that includes a softmax function for class prediction. The number of hidden neurons \(n\) has been set in such a way that \(n=\sqrt{m\times k}\), where \(m\) is the number of neurons in the input layer and \(k\) is the number of neurons in the output layer, namely the number of classes [56].
* Random Forest (RF): bootstrap-aggregated decision trees with 300 bagged classification trees.  
All the classifiers have been implemented exploiting the MATLAB Statistics and Machine Learning Toolbox and the Neural Network Toolbox.