## 4 Methodology
### Machine Learning (ML) Methods
#### 4.2.1 Support Vector Machine  
As in many other machine learning methods, SVM's modeling process involves two stages of training and testing. At the end of the training phase, testing data must be used to evaluate the generalizability of the trained model [33; 34]. The solution of the SVR problem, which is the regression model of SVM, on a dataset consisting of L samples of form \(\{(x_{1},y_{1}),\ (x_{2},y_{2}),\ldots,(x_{L},y_{L}),\ x\in R^{m},\ y\in R\}\) is a linear function in the form of Equation (1), which can estimate output values based on inputs [33]  
\[\hat{y}=\langle w.x\rangle+b \tag{1}\]  
In this equation, \(\hat{y}\) is the estimated value, \(x\) is the input vector, w is the weight vector, and b is the bias. As shown in Equation (2), the cost function introduced by [PERSON] ignores the errors within a certain distance of the true value (epsilon). In other words, it considers some deviations to be acceptable [33]. The control parameters of the response function, i.e., weight and bias vectors, are obtained by solving the optimization problem of Equation (3) [35]  
\[L(y,\hat{y})=\left\{ \begin{array}{cc}0&if\quad|y-\hat{y}|<\varepsilon\\ |y-\hat{y}|-\varepsilon&\quad otherwise\end{array} \right. \tag{2}\]  
In this equation, \(\varepsilon\) is the acceptable error in the cost function, \(\hat{y}\) is the estimated value, and \(y\) is the true value. \[ \begin{array}{cc}Minimize:&L(w,\xi)=\frac{1}{2}\|w\|^{2}+C\sum_{i=1}^{N}( \xi_{i}^{*}+\xi_{i})\\ \\ subject\ to:&\left\{\begin{array}{cc}wx_{i}+b-y_{i}\leq\varepsilon+\xi_{i}^{* }&i=1,2,\ldots,N\\ y-(wx_{i}+b)\leq\varepsilon-\xi_{i}&i=1,2,\ldots,N\\ \xi_{i}^{*}\geq 0,\xi_{i}\geq 0&i=1,2,\ldots,N\end{array}\right.\end{array}  \tag{3}\]  
In this equation, \(\|w\|^{2}\) is the weight vector, \(\xi_{i}^{*}\) and \(\xi_{i}\) are the slack variables, \(C\) is the penalty or tuning parameter. Using Lagrange coefficients, the optimization problem of Equation (3) can be converted to the Lagrangian function of Equation (4). The Lagrangian coefficients \(\alpha\) and \(\alpha^{*}\) are obtained by maximizing this function under the defined constraints. \[ \begin{array}{cc}L(\alpha^{*},\alpha)=-\varepsilon\sum_{i=1}^{l}(\alpha_{i }^{*},\alpha_{i})+\sum_{i=1}^{l}y_{i}(\alpha_{i}^{*},\alpha_{i})-\frac{1}{2} \sum_{i=1}^{l}\sum_{j=1}^{l}(\alpha_{i}^{*},\alpha_{i})\left(\alpha_{j}^{*}, \alpha_{j}\right)\left(x_{i},x_{j}\right)\\ \\ subject\ to:&\left\{\begin{array}{c}\sum\alpha_{i}^{*}=\sum\alpha_{i}\\ 0\leq\alpha_{i}^{*}\leq C\ i=1,2,\ldots,l\\ 0\leq\alpha_{i}\leq C\ i=1,2,\ldots,l\end{array}\right.\end{array}  \tag{4}\]  
The above optimization problem can be solved with the help of quadratic programming methods, in which case the global extremum will be certainly reached and there will be no risk of being trapped in local extremums [35]. Thus, after computing \(\alpha\) and \(\alpha^{*}\) in Equation (4), the optimal weight vector \(w_{0}\), the optimal bias \(b_{0}\), and the prediction function of Equation (1) can be written as Equations (5)-(7) [36]  
\[w_{0}=\sum_{support\ vectors}(\alpha_{i}^{*},\alpha_{i})x_{i} \tag{5}\]  
\[b_{0}=-\frac{1}{2}w_{0}.[x_{r}+x_{s}] \tag{6}\]  
\[f(x)=\sum_{support\ vectors}(\alpha_{i}^{*},\alpha_{i})(x_{i}.x)+b_{0} \tag{7}\]In these equations \(x_{i}\) is the input vector with which the model is trained, \(\chi\) is the new input vector, \(\mathrm{x}\mathrm{r}\) and \(\mathrm{x}\mathrm{s}\) are support vectors, \(w_{0}\) is the optimal weight vector, and \(b_{0}\) is the optimal bias value. Data points with non-zero Lagrangian coefficients are called support vectors. Geometrically, these data points have a larger prediction error than epsilon. The parameters \(\mathrm{C}\) and \(\varepsilon\) should be specified by the user. \(\mathrm{C}\) is a tuning parameter and can be set to values ranging from zero to infinity. If \(\mathrm{C}\) is set to large values, SVR will not allow errors in the training data, which results in lower generalizability.