# Short-Term Forecasting of Power Production in a Large-Scale Photovoltaic Plant Based on LSTM
## 4 Evaluation and Discussions  
### Optimal Model Parameter Selection  
As mentioned above, this study proposes 1-h-ahead forecasting of the power generation using long LSTM networks and compares with other algorithms. The summer power generation forecasting is taken as discussing example model, the training set (3136 exemplars from 1 June 2017 to 31 July 2017) is used to find the optimal parameters of the LSTM units, the validation set (147 exemplars from 1 August 2017 to 3 August 2017) is used to find the optimal layers and parameters, the test set ((147 exemplars from 4 August 2017 to 6 August 2017) is used to estimate RMSE and MAPE value after the final model has been determined. It should be pointed out that the power which is generated at night is ignored. As shown in Table 1, the detail dates for LSTM forecasting models are presented.  
In order to determine the optimal model for photovoltaic generation forecasting, layers and parameters are adjustable to analyze the impact on forecasting accuracy. As shown in Table 2, RMSE and MAPE are calculated to evaluate the forecasting performance using validation set. The initial LSTM model we used has one input layer, two hidden layers (1 LSTM layer consisted of 30 neurons and 1 dense layer with 80 neurons), 1 output layer that makes a single value prediction. The default sigmoid activation function is used for the LSTM blocks and ADAM is chosen for the model optimizer. After adding to 2 LSTM layers with 10 neurons and 2 dense layers respectively with 70 and 80 neurons, the RMSE value ranges from 11.26% to 8.21%. The forecasting performance has been improved. When the number of LSTM layers increases to 3, RMSE value increases from 8.21% to 12.92%. As the number of layers increases, the training model will have a better effect, even reaching 100% prediction accuracy. However, what follows is that the model is over-fitted, and the prediction effect is seriously reduced when the model is put on the test data. Above all, increasing the number of hidden layers may be not beneficial to forecasting performance. The hidden layer structure that has 2 LSTM layers with 10 neurons and 2 dense layers respectively with 70 and 80 neurons are determined as the final model for summer. The optimal structures for other seasons are shown in Table 3.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Dates for All Seasons** & **Training Set** & **Validation Set** & **Test Set** \\ \hline Spring & 1 March 2017 to 10 May 2017 & 11 May to 13 May 2017 & 14 May to 16 May 2017 \\ Summer & 1 June to 31 July 2017 & 1 August to 3 August 2017 & 4 August to 6 August 2017 \\ Autumn & 1 September to 31 October 2017 & 1 November to 3 November 2017 & 4 November to 6 November 2017 \\ Winter & 1 December 2017 to 5 February 2018 & 6 February to 8 February 2018 & 9 February to 11 February 2018 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Dates for LSTM (long-short term memory) forecasting models in all seasons.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline \multicolumn{4}{c}{**Layers and Parameters**} \\ \hline
**Layers and Neurons of LSTM** & **Layers and Neurons of Dense** & **RMSE** & **MAPE** \\ \hline
1 (30) & 1 (80) & 11.26\% & 2.72\% \\
2 (10, 10) & 2 (70, 80) & 8.21\% & 2.01\% \\
3 (10, 10, 10) & 1 (80) & 11.18\% & 2.76\% \\
4 (10, 10, 10, 30) & 2 (80, 80) & 12.30\% & 2.95\% \\ \hline \hline \end{tabular}
\end{table}
Table 2: Comparison of different model structures for summer in RMSE (root mean square error) and MAPE (mean absolute percentage error).