# Identification of Typical and Anomalous Patterns in Electricity Consumption
## 3 Results
### Clustering  
In this work, the elected clustering tool was the Self-Organizing Maps (SOM) [19; 20; 21; 22; 23; 24; 25] followed by k-means [26; 27; 28; 29]. These studies were developed on WEKA [30; 31] and KN-IME [32].  
SOM performs a projection of the multidimensional space of variables into a two-dimensional map, where similar patterns are close to each other. The separation of classes and determination of an adequate number of clusters is made with the support of another clustering algorithm, k-means, which is fed with the outputs of SOM.  
Several heuristics can be used to determine the \"ideal\" number of clusters. The most frequently used elbow method is based on the observation of the clustering performance curve as a function of the number of clusters, that is, to the extent that an increase in the number of clusters (k) can help in reducing the sum of variances \"within the cluster\"--var(k). Technically, given a k > 0, k groups of the dataset in question can be formed. Using k-means, the sum of variations \"within the cluster\" var(k) is calculated and a WSCC (Within Cluster Sum of Squares) var(k) curve is constructed according to the number of clusters k. The WSCC for the two cases of Figure 11 are shown in Figure 12.  
Figure 8: Example of installations labelled “Low consumption” and “Low usage”.  
Figure 10: Example of installations labelled “Concentrated consumption (month)”.  
Figure 9: Example of installations labelled “Concentrated consumption (week)”.  
Figure 13 shows the graphical result of the first part of the clustering algorithm for P_week. Each represents a subprototype of a set of consumers with similar weekly consumption distributions.  
The final step of the clustering phase consists of applying a hierarchical clustering (k-means) to group the SOM nodes into N classes (specified by the user) as illustrated in Figure 14: defining three classes on the left side and five classes on the right side.  
The clustering studies lead to four classes to define the prototypes of consumption evolution throughout the week and the months of the year. A total of five classes were stipulated to define the scale/amplitude of consumption prototypes.  
Figure 15 shows that more than half of the consumers have a regular consumption throughout the week (Class 3). Class 4 represents the consumers with higher electricity consumption during the weekends, and Classes 1 and 2 show the consumers with lower consumption during the weekends. The pie chart on the right side shows that the distribution of consumers in Classes 1, 2 and 4 is rather balanced.  
Conversely, in the month patterns (Figure 16), the number of consumers in each class is uneven. Most consumers belong to Classes 2 and 3, which is characterized by regular monthly consumption throughout the year, with a slight drop of consumption during the summer and a slight rise during the winter, respectively. Class 1 represents  
Figure 11: Clustering considering a \(5\times 5\) and \(15\times 15\) alternative maps.  
Figure 12: WOSS obtained for the maps \(5\times 5\) and \(15\times 15\).  
One final clustering exercise was applied to the annual energy consumption (Figure 17). In this case, the cluster prototypes are presented on a logarithmic scale, due to the large differences among the classes' prototype magnitudes, even within the same voltage level. In this example, Class 5 consumption is roughly 300 times higher than Class 1.  
The differences in the total available installations for each type of clustering is due to the previous filter for the concentrated consumptions. That is to say, more installations with concentrated consumption (month) were filtered.