# A Forecast Model of the Number of Containers for Containers by Voyage
## 3 Mixed Kernel Function SVM Prediction Model  
### Support Vector Machine for Regression  
A support vector machine (SVM) was officially proposed by Cortes & Vapnik in 1995, which was a significant achievement in the field of machine learning. [PERSON] et al. [16; 17] introduced an insensitive loss function \(\varepsilon\) based on the SVM classification and obtained a support vector machine for regression (SVR), in an attempt to solve the regression problem. The structural diagram of the SVR is shown in Figure 1 in which the number of allocated containers of the output container ship for one voyage, \(g(x)\), is a linear combination of intermediate nodes [33]. Each intermediate node corresponds to a support vector, \(x_{1},x_{2},\cdots,x_{l}\) represents the input variable, \(\overline{\alpha}_{i}^{*}-\overline{\alpha}_{i}\) is the network weight, and \(K(x_{i},x)\) is the inner-product kernel function [34].  
The algorithm is as follows:  
Step 1: Given a training set, \(T=\left\{(x_{1},y_{1}),\cdots,(x_{l},y_{l})\right\}\in\left(\mathbb{R}^{n} \times Y\right)^{l}\), where \(x_{i}\in\mathbb{R}^{n}\), \(y_{i}\in\mathrm{Y}=\mathbb{R},i=1,\cdots,l\).  
Step 2: Select the appropriate kernel function \(K(x,x^{\prime})\), the appropriate precision \(\varepsilon>0\) and penalty parameter \(C>0\).  
The kernel function effects the transformation from space \(R^{n}\) to Hilbert space \(\Phi:x\rightarrow\Phi(x)\), \(\Phi:x^{\prime}\rightarrow\Phi(x^{\prime})\)  i.e., it replaces the inner product in the original space, \(K(x,x^{\prime})=\left(\Phi(x)\cdot\Phi(x^{\prime})\right)\). The insensitive loss function. \(c\) is as given below:  
\[c(x,y,g(x))=\left\{\begin{array}{cc}0,&|y-g(x)|<\varepsilon\\ |y-g(x)|-\varepsilon,&\text{others}\end{array}\right. \tag{6}\]  
\(\varepsilon\) is a positive number selected in advance and when the difference between the observed value \(y\) and predicted value \(g(x)\) of \(\varepsilon\) point does not exceed a given value set in advance, the predicted value \(g(x)\) at that point is considered to be lossless, although the predicted value \(g(x)\) and the observed value \(y\) may not be exactly equal. An image of the insensitive loss function \(\varepsilon\) is shown in Figure 2.  
Step 3: Construct and solve convex quadratic programming  
\[\begin{array}{ll}\min\limits_{\alpha^{(*)}\in R^{2l}}&\frac{1}{2}\sum\limits_{i,j=1}^{l}\big{(}\alpha_{i}^{*}-\alpha_{i}\big{)}\Big{(}\alpha_{j}^{*}-\alpha_{ j}\Big{)}K\big{(}x_{i},x_{j}\big{)}+\varepsilon\sum\limits_{i=1}^{l}\big{(} \alpha_{i}^{*}+\alpha_{i}\big{)}-\sum\limits_{i=1}^{l}y_{i}\big{(}\alpha_{i}^{* }-\alpha_{i}\big{)}\\ \alpha_{i}&\\ \text{s.t.}&\sum\limits_{i=1}^{l}\big{(}\alpha_{i}^{*}-\alpha_{i}\big{)}=0\\ 0\leq\alpha_{i}^{(*)}\leq C,i=1,\cdots,l\end{array} \tag{7}\]  
The solution is given by the expression \(\overline{\alpha}^{(*)}=\Big{(}\ \ \overline{\alpha}_{1},\overline{\alpha}_{1}^{*},\ \ \cdots,\ \ \ \overline{\alpha}_{l}, \overline{\alpha}_{l}^{*}\ \Big{)}^{T}\).  
Step 4: Calculation of \(\overline{b}\): Select the component \(\overline{\alpha}_{j}\) or \(\overline{\alpha}_{k}^{*}\) of \(\overline{\alpha}^{(*)}\) in the open interval \((0,C)\). If \(\overline{\alpha}_{j}\) is selected, then  
\[\overline{b}=y_{j}-\sum\limits_{i=1}^{l}\big{(}\overline{\alpha}_{i}^{*}- \overline{\alpha}_{i}\big{)}K\big{(}x_{i},x_{j}\big{)}+\varepsilon \tag{8}\]  
and if \(\overline{\alpha}_{k}^{*}\) is selected, then  
\[\overline{b}=y_{k}-\sum\limits_{i=1}^{l}\big{(}\overline{\alpha}_{i}^{*}- \overline{\alpha}_{i}\big{)}K\big{(}x_{i},x_{k}\big{)}-\varepsilon \tag{9}\]  
Figure 1: Structure of the SVR.  
Figure 2: Insensitive loss function.  
Step 5: Construct the decision function  
\[y=g(x)=\sum_{i=1}^{l}{(\overline{\alpha}_{i}^{*}-\overline{\alpha}_{i})K(x_{i},x) +\overline{b}} \tag{10}\]