# Forecasting Electricity Prices: A Machine Learning Approach
## 4 Experimental Phase
### Experimental Settings and Results for GP-Based Systems  
This section reports the experimental settings considered for evaluating the performance of the considered GP-based systems. We tested the proposed LSGP against GSGP. A total of 100 runs were performed with each technique. This is a fundamental aspect given the stochastic nature of the considered systems. In each run, we used data until 2013 for training purposes, while the remaining data (until 2015) were used to assess the performance of the systems on unseen data (i.e., the generalization ability of the solutions). All the runs used populations of 200 individuals, and the evolution stopped after 300 generations. Tree initialization was performed using the Ramped Half-and-Half method [34] with a maximum initial depth equal to 6. The function set contained the arithmetic operators +, -, *, and protected division [34]. The terminal set contained 16 variables, each corresponding to a different feature in the dataset. Mutation was used with a probability of 0.6. For GSM, a random mutation step was considered in each mutation event. The crossover rate was 0.4. Survival from one generation to the other was always guaranteed for the best individual of the population (elitism). These values were selected \begin{table}
\begin{tabular}{c c} \hline \hline
**Variable** & **Description** \\ \hline X\({}_{0}\) & Crude oil spot price (Euro) \\ \hline X\({}_{1}\) & Settlement price EUR/t CO\({}_{2}\) (Euro) \\ \hline X\({}_{2}\) & Air temperature (degrees Celsius) \\ \hline X\({}_{3}\) & Air density (Kg/m\({}^{3}\)) \\ \hline X\({}_{4}\) & Ground temperature (degrees Celsius) \\ \hline X\({}_{5}\) & Air pressure (Pascal) \\ \hline X\({}_{6}\) & Relative humidity (expressed as a percentage) \\ \hline X\({}_{7}\) & Wind speed (meters/second) \\ \hline X\({}_{8}\) & Maximum intraday air temperature (degrees Celsius) \\ \hline X\({}_{9}\) & Minimum intraday air temperature (degrees Celsius) \\ \hline X\({}_{10}\) & Minimum intraday air temperature at ground level (degrees Celsius) \\ \hline X\({}_{11}\) & Maximum intraday wind speed (meters/second) \\ \hline X\({}_{12}\) & Next-day rain precipitation forecast to cover a horizontal ground surface (millimeters) \\ \hline X\({}_{13}\) & Next-day snow precipitation forecast to cover a horizontal ground surface (centimeters) \\ \hline X\({}_{14}\) & Sunshine duration (hours) \\ \hline X\({}_{15}\) & Snow depth (centimeters) \\ \hline TARGET & Electricity price in EUR in the following day (24 hour prediction) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Model variables available in the considered dataset. Observations collected on a daily basis; the task is to predict the target variable in the next 24 h.  
after a preliminary tuning phase that was performed through a grid-search to find the ideal values of these parameters. In particular, the training set was split into five folds, with the first four folds used to train the model, and the fifth fold used to assess the performance of the model on unseen data. At the end of this procedure, we trained the model with the whole training set, taking into account the values of the parameters resulting in the best performance on the validation fold. We tested the following parameters: for the mutation rate, values from 0.1 to 0.8 with a step of 0.05 were considered; for the crossover rate, values from 0.1 to 0.8 with a step of 0.05 were taken into account; for the number of generations, we considered the values of 100, 300, and 500; for the population size, values of 50, 100, 200, 300, and 500 were considered. The performance, across the different configurations, is stable, and increasing the number of generations and the population size beyond the considered values provided no significant improvements in performance. Fitness was calculated by using the Mean Absolute Error (MAE) between the predicted and target values.