## 5 Conclusions and Discussion  
In this paper, we have proposed a deep neural network model for day-ahead prediction of energy profiles of prosumers. Such energy prediction is a prerequisite for their active participation in energy grid management. Our model uses an ensemble of classification-based models used to cluster similar energy profiles and regression models used to fine-tune the energy prediction. We propose and successfully used the peaks and valleys of the energy profile with respect to the energy baseline as features of the learning process. Our solution addresses some of the challenges related to the use of machine learning models for energy prediction. As most of the literature is focused on one-step-ahead energy prediction, we provide a solution for the significantly difficult case of multi-step energy prediction in which 24 values are predicted in advance, corresponding to a day-ahead prediction at one hour granularity. We are not using only the raw monitored energy, but we also collect several energy-based features that are correlated with weather information. Moreover, the prediction model was tested not only on historical datasets, but also on prosumers feeding real-time energy data. We have provided a prosumer integrated solution, and the real-time data streams of energy data were considered in the training and prediction process. The software infrastructure defined allows the integration of real-time energy data streams with the deep learning models' training and prediction. Table 2 summarizes the energy prediction results for the various test case configurations used. For the small-scale prosumer, when the historical data are available, the results are significantly better than the real-time predictions, where less and more scarce energy data are available. The additional weather information, such as temperature, improves the accuracy but has a small impact on the prediction results. In the case of the medium-scale prosumer, when additional weather sensors (e.g., temperature and humidity) were added, the predictions improved significantly, and the average SMAPE decreased from 14% to 12%. \begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{2}{*}{**Evaluation Case ID**} & \multicolumn{2}{c}{**SMAPE**} \\ \cline{2-3}  & **Best** & **Average** \\ \hline TC-S1 & 2.44\% & 6.5\% \\ TC-S2 & 14.9\% & 37.58\% \\ TC-S3 & 11.2\% & 29.9\% \\ TC-M1 & 4.8\% & 14\% \\ TC-M2 & 4.7\% & 12\% \\ TC-M3 & 3.38\% & 12\% \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Energy prediction results. Figure 16: TC-M3: best predicted day (SMAPE = 3.38%). For the small-scale prosumer, the lowest average SMAPE (6.5%) is in the case in which historical data are available for a longer period (TC-S1). The performance achieved by the models in this evaluation case is higher than for the medium energy prosumer with a training set similar in size, where the average SMAPE is between 12% and 14%. The number of identified peaks' and valleys' clusters corresponding to energy consumption patterns is not higher than in the case of the small prosumer. Thus, the errors for the second prosumer can be due to a higher range of variation for the energy consumption values in the same cluster. A higher number of clusters can bring improvements for the best predicted days, but the general performance would be affected by the higher complexity of peaks and valleys classes prediction due to more similarities between clusters. Moreover, the first prosumer has a lower best-predicted day error than the prosumer with higher energy consumption (2.44% for the small prosumer, and 4.8% for the medium prosumer) when only the energy historical features are used for prediction. In the evaluation cases using live energy data streams, the data available for training are on a shorter period, and the performance of the predictions is affected. For the small prosumer (TC-S2), if only the historical energy consumption is used, the average SMAPE is 37.58%.