# Load Forecasting with Machine Learning and Deep Learning Methods
## 5 Results  
This section discusses the adjustment of the different AI techniques carried out to forecast the electrical loads in an existing building, introduced in the first sentences of Section 4. The precision of these techniques has been obtained by means of the methodology described in Section 3 and the specific modeling characteristics presented in the final paragraphs of Section 4. In this section, the bias and dispersion of the accuracy in the models are evaluated for the validation and test sets. The analysis is carried out using 10-fold cross-validation. To compare the results between different models effectively, a seed is employed. The distributions presented in the figures in this section are intended to show in detail the error distribution in the different folds. The adjustment of the different models is determined by evaluating their bias and variance. The box represents the interquartile range (_IQR_), the line that divides it is the median, the whiskers indicate the diversity within the accepted range, this being 1.5-_IQR_ over and under the third and first quartiles, Q3 and Q1, respectively, i.e., _Q3_ + 1.5-_IQR_ or _Q1_ - 1.5-_IQR_, and the circles correspond to outliers. Figure 1 shows the bias of the models and the dispersion obtained by evaluating the errors using the _nMBE_ metric in the validation set. The worst model is the SVR. This model presents an IQR of 3.03%, a value higher by 1.05% with respect to the IQR of XGBoost, the model with the next highest rate. In addition, the median of the SVR is 4.11%, this being 0.64% in the model with the next highest error, XGBoost. Both XGBoost and RF present \begin{table}
\begin{tabular}{c c c} \hline \hline
**Model** & **Hyperparameter** & **Selected Value** \\ \hline \multirow{4}{*}{All} & Patience & 100 epochs \\  & Batch size & 64 \\  & Optimizer & Adam \\  & Learning rate & 0.001 \\ \hline \multirow{2}{*}{SVR} & Tolerance & 0.001 \\  & Regularization & 1 \\ \hline \multirow{4}{*}{MLP} & Hidden layers & 4 \\  & Nodes of the hidden layers & 100, 75, 50, 25 \\  & Activations of the hidden layers & linear, linear, ReLU \\ \hline DL & Activation of the output layer & ReLU \\ \hline \multirow{4}{*}{LSTM} & Short memory & 6 timesteps \\  & Hidden layers & 3 \\  & Type of hidden layers & LSTM, dense, dense \\  & Nodes of the hidden layers & 64, 40, 20 \\  & Activations of the hidden layers & predefined, linear, ReLU \\ \hline \multirow{4}{*}{Conv-1D} & Hidden layers & 3 \\  & Type of hidden layers & LSTM, dense, dense \\  & Nodes of the hidden layers & 64, 40, 20 \\ \cline{1-1}  & Activations of the hidden layers & linear, linear, ReLU \\ \cline{1-1}  & Filters & 64 \\ \cline{1-1}  & Feature detector & 3 \\ \cline{1-1}  & Padding & 0 \\ \cline{1-1}  & Stride & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Hyperparameter selection. values above the ranges established as acceptable, i.e., 1.5-\(IQR+Q3\). Thus, these show a higher IQR and, on certain occasions, anomalous values. This does not occur in the DL models, which are more stable in the training evaluation. The DL techniques also present a lower median, especially the values of LSTM and the MLP. The bias of these two models, in contrast to the other models which underpredict, have a slight tendency to overestimate, with values of \(-0.02\%\) in the case of LSTM and 0.08% in the case of MLP. LSTM stands out, which also has a very tight IQR, with a value of 0.44%. Evaluating the fit of the \(nMBE\) metric in the test set, as presented in Figure 2, it can be seen that the SVR is still the model with the worst adjustment. In this case, its median is 4.63%. Furthermore, two outliers are observed. However, it is the model with the lowest dispersion, with an IQR of 0.12%. The rest of the ML also present a reduced dispersion, with an IQR of 0.25% in the case of RF and 1.16% in the case of XGBoost. Despite this, both models continue to have anomalous values, with 1 for RF and 3 for XGBoost. In contrast to what occurs in the training, the IQR of the DL in the test set is higher than the ML.