# Surveying Human Habit Modeling and Mining Techniques in Smart Spaces
## 6 Model Construction  
Modeling formalisms in the literature can be roughly divided into _specification-based_ and _learning-based_[1]. Research in the field of AmI started when few kinds of sensors were available and the relationships between sensor data and underlying phenomena were easy to establish. Specification-based approaches represent hand-made _expert_ knowledge in logic rules and apply reasoning engines to infer conclusions and to make decisions from sensor data. These techniques evolved in the last years in order to take into account uncertainty. The growing availability of different kinds of sensors made hand-made models impractical to be produced. In order to solve this problem, learning-based methods employ techniques from machine learning and data mining. Specification-based models are usually more _human-readable_ (even though a basic experience with formal logic languages is required), but creating them is very expensive in terms of human resources. Most learning-based models are instead represented using mathematical and statistical formalisms (e.g., HMMs), which make them difficult to be revised by experts and understood by final users. These motivations are at the basis of the research of _human-readable automatically inferred formalisms_. Learning-based techniques can be divided into _supervised_ and _unsupervised_ techniques. The former expect the input to be previously labeled according to the required output function, hence, they require a big effort for organizing input data in terms of training examples, even though active learning can be employed to ease this task. Unsupervised techniques (or weakly supervised ones, i.e., those where \begin{table}
\begin{tabular}{l l l l} \hline \hline
**References** & **RQ-B1.1** & **RQ-B1.2** & **RQ-B1.3** \\ \hline aug-eca[9] & & & & Action \\ aug-apubs[10] & & & & Action \\ \hline CASas-HMMNbCRF[16] & & & & Activity \\ \hline CASas-discorec[11; 12; 13] & & & & Activity \\ CASas-HMM[14] & & & & Activity \\ CASas-HMMNbCRF[16] & & & & Activity \\ kROS-CRF[24] & & & & Activity \\ REIG-situation[25] & & & & Situation \\ LES-PHI[31] & & & & Activity \\ BUE-WISPS[32] & & & & Activity \\ \hline CASas-ham[15] & & & & \\ \hline CASas-HMNMbCRF[16] & & & & Activity \\ kROS-CRF[24] & & & & Activity \\ \hline REIG-situation[25] & & & & Situation \\ STIK-Misvm[27] & & & & Activity \\ FEURY-MCSVM[28] & & & & Activity \\ \hline Chen-ont[18] & & & & Activity \\ rib-prob[20; 21] & & & & Action/Activity \\ nug-eyfus[22] & & & & Action \\ \hline wang-ep[19] & & & & Action/Activity \\ \hline yang-nn[26] & & & & Activity \\ \hline palmes-objrel[29] & & & & Activity \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Model type (L—Low, M—Medium, H—High)—RQ-B1.1: The type of model—RQ-B1.2: Human Readability Level—RQ-B1.3: Granularity Level. only a part of the dataset is labeled) can be used to face this challenge but a limited number of works is available in the literature. Unsupervised techniques for AmI knowledge modeling can be useful for other two reasons. Firstly, as stated in the introduction, sometimes knowledge should not be considered as a static resource; instead it should be updated at runtime without a direct intervention of the users [15], hence, updating techniques should rely on labeling of sensor data as little as possible. Moreover, unsupervised techniques may also result useful in supporting _passive users_, such as guests, that do not participate in the configuration of the system but should benefit from its services as well. Performing learning or mining from sequences of sensor measurements poses the issue of how to group events into aggregates of interests (i.e., actions, activities, situations). Even with supervised learning techniques, if labeling is provided at learning time, the same does not hold at runtime where a stream of events is fed into the AmI system. Even though most proposed approaches in the AmI literature (especially supervised learning ones) ignore this aspect, windowing mechanism are needed.