# Surveying Human Habit Modeling and Mining Techniques in Smart Spaces
## 5 Model Types
Mappings between input and output features are represented in the composition of activation functions \(f\) at a hidden layer, which can be learned through a training process performed using gradient descent optimization methods or resilient backpropagation algorithms. Some techniques stem from data mining methods for _market basket analysis_ (e.g., the Apriori algorithm [36]), which apply a windowing mechanism in order to transform the event/sensor log into what is called a _database of transactions_. Let \(I=\{i_{1},\ldots,i_{n_{E}}\}\) be a set of binary variables corresponding to sensor event types. A _transaction_ is an assignment that binds a value to each of the variables in \(I\), where the values 0 and 1 respectively denote the fact that a certain event happened or not during the considered window. A _database of transactions_\(\mathcal{T}\) is an (usually ordered) sequence of transactions each having a, possibly empty, set of properties (e.g., a timestamp). An _item_ is an assignment of the kind \(i_{k}=\{0,1\}\). An _itemset_ is an assignment covering a proper subset of the variables in \(I\). An itemset \(C\) has support \(Supp_{\mathcal{T}}(C)\) in the database of transactions \(\mathcal{T}\) if a fraction of \(Supp_{\mathcal{T}}(C)\) of transactions in the database contain \(C\). The techniques following this strategy turn the input log into a database of transactions, each of them corresponding to a window. Given two different databases of transactions \(T_{1}\) and \(T_{2}\), the _growth rate_ of an itemset \(C\) from \(T_{1}\) to \(T_{2}\) is defined as \(\frac{Supp_{T_{2}}(X)}{Supp_{T_{1}}(X)}\). _Emerging patterns_ (EP) are those itemsets showing a growth rate greater than a certain threshold \(\rho\). The ratio behind this definition is that an itemset that has high support in its target class (database) and low support in the contrasting class, can be seen as a strong signal, in order to discover the class of a test instance containing it. Market basket analysis is a special case of _affinity analysis_ that discovers co-occurrence relationships among purchased items inside a single or more transactions. Initial approaches to the development of context-aware systems able to recognize situations were based on _predicate logic_. [PERSON] [37] introduced a PROLOG extension called LogicCAP; here the  
Figure 3: Cluster hierarchical model portion example obtained by exploiting SVMs. Picture inspired by [35]. \"in-situation\" operator captures a common form of reasoning in context-aware applications, which is to ask if an entity \(E\) is in a given situation \(S\) (denoted as \(S^{*}>E\)). In particular, a situation is defined as a set of constraints imposed on output or readings that can be returned by sensors, i.e., if \(S\) is the current situation, we expect the sensors to return values satisfying some constraints associated with \(S\). LogicCAP rules use backward chaining like PROLOG, but also utilizes forward chaining in determining situations, i.e., a mix of backward and forward chaining is used in evaluating LogicCAP programs. The work introduces different reasoning techniques with situations including selecting the best action to perform in a certain situation, understanding what situation a certain entity is in (or the most likely) and defining relationships between situations. There are many approaches borrowed from information technology areas, adapted to smart environments. For instance in [38], the authors use temporal logic and model checking to perform activities modeling and recognition. The system proposed is called ARA. A graphical representation of a model example adopted by this approach is shown in Figure 4. It evidences how the activities are composed by the time correlated states between consecutive actions.