## 2 Related Work
Moreover, there are solutions based on techniques such as transfer learning [33] with good results for buildings or federated learning [34]. An improvement proposed in multiple studies for the problem of forecasting energy is using a clustering-based approach to identify energy patterns in the dataset before training the prediction models [35; 36]. Clustering approaches have been proposed to identify and group similar energy profiles and train different forecasting models for each cluster. For instance, in reference [35], a clustering method is proposed for a Functional Wavelet-Kernel approach. The clustering is made through unsupervised curve classification and groups days with similar consumption patterns. The proposed model predicts day-ahead energy-load curves at the household level, with a time granularity of 30 min. Likewise, in reference [36], a clustering is applied to find similar weather regimes to predict hourly day-ahead solar-power generation. An ensemble containing multiple random forest models is proposed to make predictions for each cluster, but the result is computed by integrating all predicted values. Self-organizing map (SOM) and learning vector quantization (LVQ) networks were proposed in reference [37] by [PERSON] et al. for PV power output classification before training multiple SVR models. The SOM model can be used to find the patterns in the power output of the PV and associate them with a defined weather type. The LVQ model is the classifier that assigns different classes for the weather features identified by using SOM. Thus, similar days are grouped based on weather data. In reference [38], the Fuzzy C-means pattern recognition algorithm was studied as an energy-consumption forecasting technique at the subentry level that is very useful in energy management. A hybrid prediction model is proposed in reference [20] to forecast hourly day-ahead energy based on consumption patterns of an office building. This work aims to improve energy prediction by using a pattern-classification strategy for the consumption profiles. Multiple forecasting models are built for patterns identified by a decision tree, using date and time information. There are patterns inside a day and for the weekdays according to the month of the year and one for the weekend. They are suitable for an office building with a fixed working schedule, and the pattern corresponding to the non-working hours has the lowest energy consumption. A similar hybrid solution based on consumption patterns is discussed in reference [39], and the energy predictions are made a day ahead with hourly time granularity for commercial buildings. The commercial buildings were classified as stationary buildings (e.g., office buildings, administration buildings, shopping malls, etc.) and non-stationary buildings (e.g., hotels or venues). The more complex energy prediction problem is for the non-stationary building where the fluctuation of the energy demand depends on the occupant's behavior. A fuzzy c-means algorithm is used to identify days and hours with similar historical consumption, and then a modified SVR with a wavelet decomposition is used for energy predictions according to the clustering results. The clustering algorithms are useful to group the consumer by their consumption patterns and reduce the number of trained models. Such an approach was presented in reference [40], and the algorithm used for clustering to recognize consumption patterns was k-Medoid. The medoids have a central location and are used as reference points to identify similar consumption patterns and to reduce the number of trained models. The transformers are grouped by considering their energy-consumption profiles, and a single model is trained for each group. In reference [41], a clustering-based approach is proposed to group consumers. The DBSCAN algorithm is used to identify clusters in a dataset with multiple consumers. The K-Means algorithm is applied to group them in low energy and high energy consumers.