# Machine Learning and Deep Learning Models Applied to Photovoltaic Production Forecasting
###### Abstract
This enables models made using Artificial Intelligence techniques to fit better and more efficiently to energy necessities over time [16]. Furthermore, these techniques can be important in preventive maintenance, since through forecasting it is possible to detect faults in the system [17]. The most common branch of Artificial Intelligence is patter recognition. Corresponding to the most employed methodologies to Machine Learning [18] and Deep Learning [19]. These are recognized for their accurate extraction of models in the field of energy, among others [20]. On the one hand, the most common Machine Learning techniques are Random Forest (RF), Extreme Gradient Boosting (XGBoost), and Support Vector Regression (SVR) [21]. On the other hand, the Deep Learning models are Standard Neural Network (SNN), Recurrent Neural Network (RNN), and Convolutional Neural Network (CNN) [22]. All the previously mentioned models have the characteristic that they can be used to forecast a labeled objective variable (Supervised Learning). On the one hand, Machine Learning techniques selected are the most commonly used. These are simple models that require little computational cost in the modeling stage and that work well with small amounts of data. Nevertheless, as the amount of data increases, their accuracy is affected since they tend to have overfitting problems. On the other hand, Deep Learning techniques are a subbranch of Machine Learning, i.e., these can model the same kind of problems as Machine Learning techniques. The main characteristic is that they use Neural Networks to reproduce the patterns. Due to the complexity that the neural networks infer they need a longer computational time to model. However, the flexibility they offer makes the models very tight, especially with large amounts of data. Despite the differences in the computation times of both techniques, when testing or forecasting in new conditions, the results are instant [23; 24]. There are several fields where Machine Learning and Deep Learning techniques have enormous importance in the nowadays development, such as additive manufacturing [25; 26; 27; 28], environment [29; 30; 31], autonomous driving [32; 33; 34], or image recognition [35; 36; 37], which exlits the impact of the techniques presented. Furthermore, all the models previously presented can be used in the forecast of photovoltaic production due to their characteristics. In fact, several researchers have performed analysis in this field using, p.eg., SVR [38], SNN [39], or CNN [40]. Nevertheless, there is not general knowledge about the capacities and possibilities of these techniques, which limits their use. Thus, in this manuscript is intended to carry out a comparative analysis of the different Machine Learning and Deep Learning models, i.e., RF, XGBoost, SVR, SNN, RNN, and CNN, to determine the most appropriate techniques to forecast photovoltaic production. The use of this type of techniques is crucial to cover the gap in energy and economic stability in development of projects in which renewable energy sources are present. Thus, benefiting the knowledge in the field of management systems in buildings where the photovoltaic source is utilized, i.e., ZEB, nZEB, and MG. In order to ensure the reliability of the models, a seed has been used. In the training process, standstills in local minima have been avoided by using a training process based on mini batch gradient descent with cross-validation applying the Adam optimizer. To ensure an adequate adjustment of the Artificial Intelligence methods, in a previous step to the modeling, a preparation stage has been carried out, in which data cleaning, data mining, and scaling techniques have been applied.