## 5 Inhabitants' Activity Tracking  
An important factor that influences energy consumption within the home is occupant behaviour. Tracking the occupants' activity within the home or, in other words, activity discovery, recognition, and prediction play a significant role in a smart home concept. This can be called the vital part of a smart home system due to its effect on both occupants' comfort and building energy management. \"Action\" and \"activity\" are the terms that are commonly used for describing physical behaviours. They are used interchangeably in some cases but in other cases they are used to interpret different complexity and duration of behaviours [82].  
The occupants' activity can be goal-oriented, and it could be complicated. The activity could be as simple as a single objective and collection of serial events or it could be as complex as a multi-objective and non-sequential collection of happenings. Concurrent and interleaved activities can be considered as a complex activity. Consider the following as an example of a concurrent activity: An occupant in his activity of going to the bathroom passes by the laundry room to load and schedule the washing machine. In this example, there are two purposes in the activity: Scheduling the washing machine and taking a shower. As an example of the interleaved activity, consider the occupant responding to a ringing-phone while cooking in the kitchen. In this scenario the occupant should stop the cooking activity and pick up the phone; when the conversation is finished, the occupant returns to the cooking activity [83].  
As discussed in the previous section, tracking the occupants' activity depends on the type and accuracy of sensors used within the house. In addition to the sensors, for monitoring the occupant's activity at the household, a smart home system needs to use activity recognition mediums. The smart home system needs to be able to recognize the occupant's activities, so it is necessary that the activities be categorized based on types or significant features. As sensory data has a temporal-ordered nature, the recognition-of-activity classification would be equally challenging as the sequence classification (SC) problem. There are three general SC methods [84]:  
* Featured-based classification
* Sequence distance-based classification
* Model-based classification  
In the featured-based methods, first a sequence will be transformed into a feature vector and then conventional classification methods such as \(k\)-gram and pattern-based feature selection will be applied [85]. In the sequence distance-based methods, the similarity of the sequences will be measured by the distance function and then the classification quality will be determined (e.g., \(K\) nearest neighbour classifier and support vector machine) [86], model-based methods using the Hidden Markov Model (HMM) and other statistical models for sequence classification [87].  
Generally, the data generated by sensors can be analyzed from two aspects: Lower-sensory level and higher-activity level [88]. The lower-level analysis classifies activities using data read from the sensors. The higher-level analysis analyzes the classified labels of activities for further processes of decision-making. In the lower-level analysis, according to the availability of data instance, supervised learning is employed to learn the data instance model. This process is well known as activity recognition (AR). To discover activity labels without having data instance, an unsupervised learning approach can be used, popularly known as the activity discovery (AD) process. There are a variety of classification techniques such as information theory, statistics, machine learning, data mining, ontologies, and others.