## 2 Clustering and Classification Framework
### Clustering Based on Fuzzy Inference Systems  
Fuzzy inference systems (FISs) are intelligent technics that are able to capture human behavior and consider its adaptive characteristics. FISs consist of the fuzzified, the rule base, the fuzzy inference engine, and the defuzzyfier.  
Fuzzyfication consists of decomposing data inputs into one or more fuzzy sets. Each data set is associated with one membership function, which can be triangular-, Gaussian-, or trapezoidal-shaped. This process allows the system inputs to be expressed in linguistic terms, and not as integral-differential equations or models traditionally used in systems theory. Therefore, the universe of discourse of the crisp input variables is converted by these membership functions. The inference engine determines how the fuzzy logic operators (or, and, sum, prod) are performed. To express the linear or nonlinear relationships identified in the analyzed system, the inference uses fuzzy IF-THEN rule types. These can be applied simply, and together build the knowledge base/rule base. There are two important types of inference: Mamdami and Sugeno [16], which compute the output of each rule. The defuzzification module converts the outputs of inference to crisp values using different methods: center of gravity, weighted average, and so on [17].  
An FIS can start to classify the environment on behalf of the human, according to his desires, once the clustering algorithm integrated has extracted the membership functions and the set of rules from the user input/output data.  
The Fuzzy-C-Means (FCM) [18; 19; 20] is a fuzzy clustering approach that extracts fuzzy membership functions from user data, using fuzzy partitioning prototypes. It uses a set of instances with r attributes that have been arbitrarily grouped into p clusters, reflecting a data set that is partitioned into r parts. Then, the centers for each cluster are determined by the algorithm which uses the instances that were arbitrarily labeled. In order to assign each instance with a degree of membership to each cluster, these centers are used to calculate the distances of each instance from each cluster center. The dataset's division becomes fuzzified in this way.  
Figure 1: SOM training algorithm steps.  
In order to reduce the dissimilarity function between data points and cluster centers in the training data set, this approach attempts to repeatedly change the data set's partitioning. FCM evaluates the separation between the clusters using the r-dimensional Euclidean features.  
This fuzzy clustering algorithm was chosen as a result of its ability to operate on fuzzy data, in which a data point may, at any given time, have a degree of fuzzy belonging to more than one cluster. When the goal is to create models at a specific level of information granulation that can be described in terms of fuzzy sets, this is a quick and efficient method for generating fuzzy information functions from user data [21; 22; 23]. In addition, FCM proved to be effective in dealing with a variety of highly complex problems, such as energy scheduling in smart grids that integrate photovoltaic panels [24; 25; 26], due to their generalization features and their ability to take into consideration consumers' energy preferences.  
In our approach, we measured, with the help of smart metering instruments, the amount of energy from RES consumed by a series of programmable interruptible consumers in the house, i.e., a washing machine, dishwasher, and air conditioner, to obtain profiles of electric energy consumers, for each day of the week. The result of these computations was a database of daily profiles used for training two SOM architecture types (SOM1 and SOM2) and the FCM algorithm. These structures were then tested to classify new load profiles (see Figure 2).