# Surveying Human Habit Modeling and Mining Techniques in Smart Spaces
## 6 Model Construction
As described in [17], the different windowing methods can be classified into three main classes, namely, _explicit_, _time-based_ and _event-based_. * _Explicit segmentation._ In this case, the stream is divided into chunks usually following some kind of classifier previously instructed over a training data set. Unfortunately, as the training data set simply cannot cover all the possible combinations of sensor events, the performance of such a kind of approach usually results in single activities divided into multiple chunks and multiple activities merged. * _Time-based windowing._ This approach divides the entire sequence into equal size time intervals. This is a good approach when dealing with data obtained from sources (e.g., sensors like accelerometers and gyroscopes) that operate continuously in time. As can be easily argued, the choice of the window size is fundamental especially in the case of sporadic sensors as a small window size could not contain enough information to be useful whereas a large window size could merge multiple activities when burst of sensors occur. * _Sensor Event-based windowing._ This last approach splits the entire sequence into bins containing an equal number of sensor events. Usually, bins are in this case overlapping with each window containing the last event arrived together with the previous events. Whereas this method usually performs better than the other, it shows drawbacks similar to those introduced for time based windowing. In aug-eca[9], the rules composing the model are written by experts, so the model formalism is based on knowledge bases. The rules will be evaluated by exploiting evidential reasoning (ER) and the parameter for the ER are trained in a supervised way. The rules structure follows the Event-Condition-Action (ECA) paradigm, borrowed by database techniques. The rules specify how the system has to react to a given event in a specific context. The action performed by the system influences the status of the system itself, potentially generating another event managed with a reaction is other rules. Figure 6 shows some examples of ECA rules used to model some activities. The structure has the typical layout of a IF-THEN construct, in which the conditions represent sensor triggering (or its interpretation), and the conditions are expressed as probabilities regarding the context elements and the auxiliary actions performed. The limits of this approach are related to the big effort needed to model successfully the environment and the possibility of producing conflicting conditions. The evolution in specification-based approaches to overcome the previous limits is represented by ontologies. In chen-ont[18], an activity is modeled as a class: the entities and the properties correlated to them are divided in three groups (see Figure 7). The first one is about the context, the second group represents the causal and/or functional relations, the properties of the third group denote the type and interrelations* [FIGURE:S  
Figure 6: Example of ECA rules modeling “Eating”, “MealPreparation”, “WashDishes” activities. Pictures inspired by aug-eca[9]. Figure 7: Ontologies used in Chen-ont[18] to model the aspects of smart spaces. (**a**) Ontology example used to model the Smart Environment domain. Picture inspired to chen-ont[18]. (**b**) Ontology example used to model the activities correlations. Picture taken from chen-ont[18]. (**c**) Ontology example used to model the sensors properties. Picture taken from chen-ont[18]. In rib-prob[20; 21], the multilevel model is obtained combining ontologies and/or grouping elements at previous levels. The Atomic Gestures model is obtained just considering log elements. The Manipulative Gestures are computed considering ontology and axioms. The Simple Activities are obtained grouping Manipulative Gestures. Finally, for Complex Activities, ontologies are involved. Figure 5 represents a portion of the resulting ontology model. The dashed lines represent the relations super/sub between classes.