2.4.3. Selection of Best Model

Once the training and testing temporal samples have been selected, the different ANN models are built. The number of hidden layers (varying between zero and two) and the number of neurons inside each of the input and hidden layers are the only configuration parameters that differ between models. The number of neurons of the output layer is fixed by the number of output variables (only one, i.e., PV power production), as already stated. All other configuration parameters are kept constant.

With the required parameters defined for all neural network models, the training dataset of the second scenario is fed into each ANN model, using hours of data from the training sample. Then, the testing dataset from the same scenario is fed into each trained model to generate PV power estimations, using the first testing sample of random days. These estimations are compared against the corresponding monitored values of PV outputs, and mean nRMSE values are obtained for each tested ANN model. The same process is done again, training and testing each model from zero using data from the third scenario.

The best neural network model is chosen considering the combination of the nRMSE mean errors from the second and third scenarios. This best ANN model is comprised of an input layer of five neurons and a single hidden layer of 30 neurons, in addition to the single-neuron output layer. This selected architecture is shown in Figure 3. The second and third test samples are finally used to evaluate the performance of the chosen model for all three scenarios, as explained on the Results and Discussion section.

**Figure 3.** Layer architecture of the best ANN model.
