## 3 Methodology
### Least Square Support Vector Machine (LSSVM)  
Unlike traditional SVM, LSSVM achieves dimensionality reduction by converting the original optimization problem with inequality constraints into one with equality constraints as introduced by [48]. This transformation allows LSSVM to utilize non-linear kernel functions, effectively projecting the input data into a higher-dimensional feature space. In this study, LSSVM is leveraging to construct an error compensation model that minimizes the difference between actual and forecasted energy consumption. Let us denote the training \begin{table}
\begin{tabular}{l l} \hline \hline
**Parameter** & **Value** \\ \hline Number of nodes in hidden layer & 100 \\ \hline Output shape & None, 100 \\ \hline Layer & 1 (Dense\_1) \\ \hline Training algorithm & Trainim \\ \hline Data division function & 70/20/10 \\ \hline Transfer function\(-\)hidden layer & logsig \\ \hline Transfer function\(-\)output layer & purelin \\ \hline Activation function & Scaled exponential linear unit (Selu) \\ \hline Optimizer & Adam \\ \hline Epoch & 100 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Architecture of DNN. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Dataset** & **Period (Year 2021)** & **Total Days** \\ \hline
**Training set** & week 1 of January–week 2 of September & 252 days \\ \hline
**Validation set** & week 3 of September–week 3 of November & 72 days \\ \hline
**Testing set** & week 4 of November–week 3 of December & 30 days \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Forecasting dataset information. data as \(D=\{(x_{1},\,y_{1}),\,(x_{2},\,y_{2}),\,...,\,(x_{n},\,y_{n})\}\), where \(x_{i}\) represents the \(i\)-th input vector and \(y_{1}\) represents the corresponding output (actual energy consumption). The LSSVM function for this model, mapped to the high-dimensional space, can be expressed as:  
\[y(x)=\omega^{T}\varphi(x)+b \tag{5}\]  
where \(\varphi(x)\) is the non-linear mapping function that projects the input vector \((x_{i})\) into a higher-dimensional space, \(b\) is the bias term that influences the overall prediction, and \(\omega\) is the weight vector that determines the influence of each feature in the high-dimensional space. This transformation through the non-linear mapping function allows the LSSVM to capture complex relationships between the input variables and the output, ultimately leading to a function optimization problem that can be expressed as:  
\[\min\!J(\omega,\,e)=\frac{1}{2}\|w\|^{2}+\frac{1}{2}\gamma\sum\limits_{k=1}^{ N}\epsilon_{k}^{2} \tag{6}\]  
This transformation is achieved through the following equality constraint:  
\[y_{k}=\omega^{T}\varphi(x_{k})+b+e_{k} \tag{7}\]  
where \(\varphi(x_{k})\) is non-linear mapping of the k-th input vector (projected to high-dimensional space) while \(e_{k}\) is a slack variable. To solve the LSSVM function optimization problem, a technique called Lagrangian transformation is employed. This method introduces Lagrange multipliers (\(a_{k}\)) to convert the equality constraints (Equation (7)) into an unconstrained Lagrangian function (\(L\)), defined as in Equation (8):  
\[L(\omega,b,e,a)=J(\omega,e)-\sum\limits_{k=1}^{N}a_{k}[\omega^{T}\varphi(x_{k} )+b+e_{k}-y_{k}] \tag{8}\]  
By applying the Karush-Kuhn-Tucker (KKT) conditions as in Equation (9), the Lagrangian function is minimized to obtain the optimal values of the \(\omega\), \(b\), \(e_{k}\), and \(a_{k}\). This optimization process ultimately leads to the LSSVM model for error compensation in forecasting. \[\text{KKT}\left\{ \begin{array}{c}\frac{\partial L}{\partial\omega}=0\to \omega=\sum\limits_{k=1}^{N}a_{k}\varphi(x_{k})\\ \frac{\partial L}{\partial b}=0\to\sum\limits_{k=1}^{N}a_{k}=0\\ \frac{\partial L}{\partial e_{k}}=0\to a_{k}=\gamma e_{k},k=1,2, \ldots,N\\ \frac{\partial L}{\partial a_{k}}=0\to\omega^{T}\varphi(x_{k})+b+e_{k}-y_{k}, k=1,2,\ldots,N\end{array} \right. \tag{9}\]  
Equation (10) is obtained after a thorough calculation as follows:  
\[