# Short Term Electric Load Forecasting Based on Data Transformation and Statistical Machine Learning
## 3 Results
Therefore, the proposed method offers a solution to the forecasting problem, when data shortage is present and small scale cases are employed. Figure 5: Metrics for the Household case: Household MAE and Household RMSE. The household and office datasets are the most challenging ones, since they exhibit low auto-correlation and higher volatility/stochasticity compared to the rest. In the household case, the minimum MAE corresponds to batch sizes (144 observations/day) of 288 and 864 observations respectively (both multiples of 144). Since the minimum RMSE corresponds to a forecasting period of 864 observations, experimental data with different batch sizes indicated that the batch size should be chosen to be 864. Similarly, for the Trento dataset the batch size is chosen at 144 (144 observations per day). The batch size for the office dataset is chosen accordingly. The selected batch sizes for each dataset are summarized in Table 4. The best RMSE and MAE values are derived as a multiple of the number of the batch observations for each dataset. This is derived as a result of the ACF analysis. In Table 5-7, the summarized results of MAE and RMSE for all models and for every dataset are presented. Figure 6: Metrics for the Office case: Office MAE and Office RMSE. Figure 7: Metrics for Trento case: Trento MAE and Trento RMSE. At this point we have a clear picture of the dataset transformation. As shown in Figure 8, we started from a sequential time series dataset and transformed it accordingly into a matrix. The transformed data are then ready to be fed into the CNN model. If the statistical analysis concludes that the interval with the highest correlation is that corresponding to the same time the day before, we have an 1D image. If it corresponds to that of the same time two days ago, we have a 2D image \(n\) (observations per day) \(\times\) 2 (days ago) image. The \(n\)\(\times\) 2 multiplication implies the resulting filter length following the same reasoning as with the batch size tuning (the filter length should be equal to batch size or to a derivative of that). The proposed methodology was developed and tested in Python with Keras library the backend of which is Tensorflow. Based on the experimental results shown in Tables 5-7 the methodology appears to have good performance and the model selection approach, works satisfactorily even for datasets that exhibit high variability. Our approach was compared against a number of other well reputed AI algorithms such as LSTM, ANN and MLP. These models were chosen due to the fact that are widely accepted in literature and are considered to be suitable for time series forecasting applications, like load forecasting, thus forming a valid candidate for the problem under examination. Regarding ANN we have chosen one hidden layer while for MLP, CNN and LSTM the hidden layers were 5. Such choices were made by trial and error, i.e., adding more hidden layers did not enhance the prediction accuracy. The activation function used was ReLU and the number of epochs was 150 for all models; the optimizer was RMS-Prop and the additional parameters for CNN were the following: size of filter 3 \(\times\) 3, number of input filters 24, maximum pooling size 3 \(\times\) 3, and size of strides 1. The batch size was settled based on the methodology explained earlier for all models. The forecast chosen is the \"Day ahead\" one as defined by the electricity market. The \"Day ahead\" market is essential for the operation of the power system since a better forecasting tool means that a market participant (i.e., an aggregator, balance responsible party, local energy market operator etc) will make better choices for the next day operation and will minimize the costs that low-accuracy forecasts would bring (high deviations from the forecasted load would mean higher cost in order to balance the system). In our case study the forecast horizon was restricted by the limited availability of historical data.