## 3 The Structure of the Decision Support Platform
### The Profiling Module
#### 3.3.2 Clustering-Based Method in Profiling Process  
Clustering represents a special process to group the data recorded in the matrix \(DW\) on the columns associated with the energy consumptions given by the sampling step (24, 48, or 96), represented by \(p\) daily profiles introduced as vectors \(W_{ixm}\), \(i=1,\,\ldots,\,p\), \(m=\{24,\,48,\,96\}\). If all energy consumption profiles from matrix \(DW\) are considered, then \(p=N_{W}\). \[[W]_{N_{W}xm}=\left[ \begin{array}{c}W_{1}\\ W_{2}\\ \ldots\\ W_{p}\end{array} \right]=\left[ \begin{array}{cccc}w_{1,1}&w_{1,2}&\ldots&w_ {1,m}\\ w_{2,1}&w_{2,2}&\ldots&w_{2,m}\\ \ldots&\ldots&\ldots&\ldots\\ w_{p,1}&w_{p,2}&\ldots&w_{p,m}\end{array} \right] \tag{6}\]  
The vectors associated with the energy consumption profiles \(W_{i}\), \(i=1,\,\ldots,\,p\), \(m=\{24,\,48,\,96\}\), are merged into different clusters, according to the distance calculated between each of them. Finally, one or more clusters (also called groups, patterns, models, classes, or categories) will be obtained in function by the spatial location of the characteristics of vectors \(W_{i}\), \(i=1,\,\ldots,\,p\). The characteristics of vectors will be closer to the common centre of the cluster they belong, compared to centres of other clusters. The stages of the clustering process are shown in Figure 6.  
_Extract the energy consumptions from matrix DW_: It refers to values the energy consumption from the columns of matrix \(DW\) subject to the clustering process and recorded in the vectors \(W_{i}\), \(i=1,\,\ldots,\,p\). _Data preprocessing_: Due to various random factors, the energy consumption profiles can contain abnormal, deviation, unrepresentative, noisy, strange, anomalous, or missing data. It is very important to detect and repair or eliminate the anomalous or abnormal values before the use of the energy consumption profile in the profiling process. A statistic-based data mining technique is applied to solve these problems [53]. _Data normalization_: The normalization process uses the hourly values of energy consumption from each vector \(W_{i}\), \(i=1,\,\ldots,\,p\), a suitable normalizing factor represented by the average consumption,  
Figure 6: The steps completed to obtain the typical energy consumption profiles (TECPs). the maximum value of consumption, or the total energy consumption over the analysed period. This process is mandatory because all data must be brought in the range [0, 1] in the clustering process. \[w_{i,j}^{norm}=\frac{w_{i,j}}{\sum\limits_{i}w_{i,j}};\,i=1,\,\ldots,\,p;\,j=1, \,\ldots,\,m,\,m=\{24,\,48,\,96\} \tag{7}\]  
where \(w_{i,j}^{norm}\)--normalized value of the energy consumption \(j\) from the record \(i\), \(w_{ij}\)--the energy consumption \(j\) from the record \(i\), and \(\sum\limits_{i}w_{ij}\)--the energy consumption over the analysed period, identical with working schedule. _The clustering process_: The clustering process can be carried out in several ways, depending on the methods chosen by the Decision-Maker. Inside of each method, a distance is chosen to determine the similarity between vectors \(W_{i}\), \(i=1,\,\ldots,\,p\), associated with the energy consumption profiles. Many measurement systems use different distances in the clustering process, but from them, the Euclidean distance is the most used. Thus, the distance, in the case of two vectors \(W_{r}\) and \(W_{s}\), is calculated with the relation:  
\[d(W_{r}^{norm},W_{s}^{norm})=\sqrt{(W_{r}^{norm}-W_{s}^{norm})\,(W_{r}^{norm}- W_{s}^{norm})^{t}},\,r\
eq s \tag{8}\]  
All clustering methods should lead, in principle, to representative clusters, indifferently by the input data. There are cases when these clusters could not be obtained. Using another method represent an alternative to obtain better results than previous cases to identify a solution. The quality of the results can be the best when the separation of the elements leads to the well-defined clusters or less good when a membership degree to one of the clusters is associated.