## 2 Short-Term Traffic Flow Prediction Model Construction
### Construction of SVR Short-Time Traffic Flow Prediction Model Based on Associated Roads
#### 2.2.2 SVR Principle  
SVR constitutes a regression technique derived from support vector machines (SVMs), designed to address regression challenges. It builds regression models by finding the best hyperplane in the training dataset [32; 33]. As shown in Figure 1, this is equivalent to constructing an interval band of width \(2\varepsilon\) centered on \(f(x)\), and if a training sample falls into this interval band, it is considered to be correctly predicted, and the optimal hyperplane is a plane obtained to maximize the classification interval. The data training sample consists of a category of features with a feature vector whose training sample expression is as follows: \(D_{i}=\{x_{i},y_{i}\}\). Here, \(x_{i}\) is used as an input vector to the short-duration traffic flow model, and \(y_{i}\) is used as its category marker. The large interval division hyperplane is obtained along with the corresponding model as follows:  
\[f(x)={w_{i}}^{T}x+b \tag{3}\]  
where \(w\) is the normal vector to the hyperplane, \(x\) denotes the sample value, and \(b\) denotes the deviation value. The distance from any point \(x\) in the sample space to the hyperplane can be written as follows:  
\[\delta_{i}=\frac{1}{||w||}\bigg{|}f(x_{i})\bigg{|} \tag{4}\]  
Given input data and learning objectives,  
\[X=\{X_{1},X_{2},\ldots,X_{n}\},\ Y=\{Y_{1},Y_{2},\ldots,Y_{n}\}\]  
The training process of the model is the process of finding the optimal \(w\) and \(b\). Eventually, a set of parameters \(w\) and \(b\) are obtained to make \(f(x)\) closest to \(y\). The problem is transformed into a convex quadratic programming problem, which can be represented as follows:  
\[ \begin{array}{l}\max\frac{2}{||w||}\Leftrightarrow\min\frac{1}{2}||w||^{2},\\ s.t.y_{i}(w^{T}x_{i}+b)\geq 1,i=1,2,\ldots,m\end{array}  \tag{5}\]  
It is important not only to maximize the spacing band but also to minimize the loss as a means of determining \(w\) and \(b\). Thus, the SVR problem can be formalized as follows:  
\[\min\frac{1}{2}||w||^{2}+C{\sum_{i=1}^{m}l_{\varepsilon}(f(x_{i})-y_{i})} \tag{6}\]  
where C is a regularization constant, and \(l_{\varepsilon}\) is an \(\varepsilon\)-insensitive loss function as shown in Figure 2.  
Figure 1: The schematic diagram of the optimal hyperplane. Figure 2: \(\varepsilon\)-insensitive loss function. Since it is often difficult in real tasks to directly determine the appropriate \(\varepsilon\), ensuring that most of the data will fall within the interval bands, and SVR expects all the training data to fall within the interval bands, the relaxation variable \(\zeta\) is added so that the function's spacing requirements become relaxed, i.e., some samples are allowed to fall outside of the interval bands. As shown in Figure 3:  
Introducing slack variables \(\zeta_{i}\) and \({\zeta_{i}}^{*}\), Equation (6) can be rewritten as follows:  
\[ \begin{array}{l}\underset{w,b,\zeta_{i}}{\min}\frac{1}{2}||w||^{2}+C{\sum_{i= 1}^{m}}\left({\zeta_{i},{\zeta_{i}}^{*}}\right),\\ s.t.f(x_{i})-y_{i}\leq\varepsilon+{\zeta_{i}},\\ y_{i}-f(x_{i})\leq\varepsilon+{\zeta_{i}}^{*},\\ {\zeta_{i}}\geq 0,{\zeta_{i}}^{*}\geq 0,i=1,2,\ldots,m\end{array}  \tag{7}\]  
In order to minimize the objective function, a Lagrangian function is constructed based on the constraints. By introducing the Lagrange multiplier \(u_{i}\geq 0,{u_{i}}^{*}\geq 0,{\zeta_{i}}\geq 0,{\zeta_{i}}^{*}\geq 0\), the calculation yields the following:  
\[ \begin{array}{l}L(w,b,\alpha,{\alpha^{*}},{\zeta_{i}}^{*},\mu,{\mu^{*}})= \frac{1}{2}||w||^{2}+C{\sum_{i=1}^{m}}\left({\zeta_{i},{\zeta_{i}}^{*}} \right)-{\sum_{i=1}^{m}}\,{u_{i}}{\zeta_{i}}\\ -{\sum_{i=1}^{m}}\,{u_{i}}^{*}{\zeta_{i}}^{*}+{\sum_{i=1}^{m}}\,{\alpha_{i}}( f(x)-y_{i}-\varepsilon-{\zeta_{i}})+{\sum_{i=1}^{m}}\,{{\alpha_{i}}^{*}}(y_{i}-f(x _{i})-\varepsilon-{\zeta_{i}}^{*})\end{array}