## 4 Evaluation  
### Experimental Setup  
In order to validate our algorithm, we have used the dataset published by [PERSON] et al. [14]. The dataset has been selected because it is widely used in the activity recognition and intelligent environment literature. This allows other researchers working in both areas to better compare the results of this paper with their own work. The dataset is the result of monitoring a 26-year-old man in a three-room apartment where 14 binary sensors were installed. These sensors were installed in locations such as doors, cupboards, refrigerators, freezers or toilets. Sensor data for 28 days was collected for a total of 2120 sensor events and 245 activity instances. The annotated activities were the following: \"LeaveHouse\", \"UseToilet\", \"TakeShower\", \"GoToBed\", \"Prepare Breakfast\", \"Prepare Dinner\" and \"Get Drink\". In this specific case, the sensors were mapped one to one to actions, resulting in the following set of actions: \"UseDishwasher\", \"OpenPansCupboard\", \"ToiletFlush\", \"UseHallBedroomDoor\", \"OpenPlatesCupboard\", \"OpenCupsCupboard\", \"OpenFridge\", \"UseMicrowave\", \"UseHallBathroomDoor\", \"UseWashingmachine\", \"UseHallToiletDoor\", \"OpenFreezer\", \"OpenGroceriesCupboard\" and \"UseFrontdoor\". For the training process, the dataset was split into a training set (80% of the dataset) and a validation set (20% of the dataset) of continuous days. These sets were composed by the raw sensor data provided by [PERSON] et al. In order to make the training process more streamlined, we apply the sensor to action mappings offline. This allows us to train the deep neural model faster while still having the raw sensor data as the input. To do the training, we use \(n\) actions as the input (as described in the sequence-length experiments) to predict the next action (see Section 4.2 for a description of how accuracy is evaluated). That is, the training examples are the sequences of actions, and the label is the next action that follows that sequence, being a supervised learning problem. The proposed architectures have been implemented using Keras and were executed using TensorFlow as the back-end. Each of the experiments was trained for 1000 epochs, with a batch size of 128, using categorical cross-entropy as the loss function and Adam [42] as the optimizer. After the 1000 epochs, we selected the best model using the validation accuracy as the fitness metric. The action embeddings  
Figure 3: Long short-term memory network (LSTM) for behaviour modelling. were calculated using the full training set extracted from the [PERSON] dataset and using the Word2 Vec [34] algorithm, and the embedding layer was configured as trainable. To validate the results of the architecture, we performed three types of experiments:  
* Architecture experiments: we evaluated different architectures, varying the number of LSTMs and fully connected dense layers. * Sequence length experiments: we evaluated the effects of altering the input action sequence length. * Time experiments: we evaluated the effects of taking into account the timestamps of the input actions. For the architecture experiments (see Table 1), we tried different dropout values (with a dropout regularization after each fully connected layer with a ReLU activation), different numbers of LSTM layers, different types of LSTM layers (normal and bidirectional [43]), different numbers of fully connected layers and different sizes of fully connected layers. We also compared using embeddings for the representation of the actions versus the more traditional approach of using one-hot vectors, in order to ascertain the improvements that the embeddings provide. For the sequence-length experiments (see Table 2), we varied the length of the input action sequence in a network, but maintained the rest of the values to a dropout regularization of 0.8, one LSTM layer with a size of 512, two fully connected layers with ReLU activation with a size of 1024 and one final fully connected layer with softmax activation.