# Context-Based Energy Disaggregation in Smart Homes
## 5 Experimental Results
### Appliance Profiling  
In order to extract the power levels that typically characterize an appliance consumption, we analyzed all the available traces for each appliance in our subset. As mentioned above, according to the consumption behavior and the nature of the devices, each device consumption profile can be approximately characterized by just few power states. To identify them, we generated for each type of device a power value occurrence histogram aimed at highlighting the most frequently achieved values ranges. After this operation, a further sub-sampling operation is performed. The zero power, which corresponds to the disconnected state, could, in fact, mislead the research of accumulation values as it reasonably represents, except for the \"always ON\" appliances, the most frequent sample value. Therefore, a coherent sub-sampling has been applied by processing each sequence through a sliding window of fixed size (10 samples); in the case where the samples observed in the window result all 0, nine values of these will be barred from the data on which to search the state value. After this pre-processing phase, the problem of determining the intrinsic structure of the data to be grouped, in the case that only the observed values result accessible have been considered; hence the preciseness of the state extraction has been tested through clustering analysis [43]. Clustering analysis organizes the data according to an abstract structure in order to recognize groups or hierarchies of groups. A cluster is composed of a number of similar objects collected or grouped together according to a specific parameter named distance. How the distance is set up and which parameter it represents depends on the chosen algorithm and on the type of data to be processed. In our experimentation case, the objects are represented by the power values; the clustering algorithm has to evaluate and group them together in order to extrapolate few power states that could effectively describe the consumption behavior of each type of appliance. The clustering \begin{table}
\begin{tabular}{c c c} \hline \hline
**Device Type** & **\#Appliances** & **\#Traces** \\ \hline Coffee Maker & 5 & 39 \\ LCD TV & 10 & 94 \\ Microwave Oven & 5 & 48 \\ PC Desktop & 9 & 90 \\ Refrigerator & 7 & 130 \\ Washing Machine & 7 & 22 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Tracebase subset of appliances used in our approach. Data have been partially reproduced from [10]. algorithm identifies few mean values and their associated variances that could represent as accurately as possible each consumption state. To solve our problem, we made preliminary tests with some clustering algorithms; \(k\)-means [44] and Gaussian Mixture Model (GMM) [45] reported the most consistent results. With \(k\)-means, given a set of \(n\) points defined in a \(d\)-dimensional space \(R^{d}\) and an integer \(k\), the problem consists in determining a set of \(k\) points, belonging to \(R^{d}\), called centroids, such that each mean squared distance for each point belonging to the cluster is minimal when compared to the centroid. In our case, the centroids represent the states of the descriptive model which is associated with each device observed. This type of technique usually fails in the general categories of clustering that are based on the variance [46]. As mentioned above, we have also investigated a probabilistic approach, named Gaussian Mixture Model (GMM). It is assumed that the data are generated by a mixture of latent probability distributions in which each component represents a different group of clusters [43]. It consists in the weighted sum of \(M\) components of Gaussian densities as described by the following equation:  
\[p(x|\lambda)=\sum_{i=1}^{M}\omega_{i}g(x|\mu_{i},\sum_{i}), \tag{4}\]  
where \(x\) is a \(D\)-dimensional data vector (e.g., measured features), \(\omega_{i}\)\((i=1,...,M)\) represent the mixture weights and \(g(x|\mu_{i},\sum_{i})\) with \((i=1,\ldots,M)\) are the components of Gaussian densities.