# Stream Data Load Prediction for Resource Scaling Using Online Support Vector Regression
## 4 Improved Online SVR for Stream Data Load Time Series Prediction  
The stream data attributes of network log include time record, IP address, username, request type, state, load (with wordcup98 as an example). In this paper, the time record and load are selected as the research attributes. The historical stream dataset is represented as \(Z=\left\{(x_{1},y_{1}),(x_{2},y_{2}),\ldots,(x_{i},y_{i})\right\}\in(X\times Y )^{l}\). \(X\) represents the time feature vector, and \(\mathbf{Y}\) represents the stream data load feature vector. When stream data in the past is set as training samples, constructing an online SVR prediction function as \(f(x)=w^{T}\phi(x)+b\). The nonlinear mapping \(\phi(*)\) represents the feature vector after the mapping of the \(x\). It maps the feature space of the input stream data set to high dimensional feature space, so that the function in the high dimensional feature space can be expressed as a linear regression function. \(w\) represents the normal vector of hyperplane in time eigenvector space, and it determines the direction of hyperplane. \(b\) is the displacement term, and it determines the distance between the hyperplane  
Figure 1: The article system architecture. and the origin. Obviously, the partition hyperplane is determined by the normal vector \(w\) and the displacement \(b\). If you want to get an accurate predictive function, you need to find the maximum interval distance of hyperplane. Therefore, we write the problem into a convex optimization problem:  
\[ \begin{array}{c}\min\frac{1}{2}\|w\|^{2}\\ s.t.\left\{\begin{array}{l}y_{i}-w^{T}\phi(x_{i})-b\leq\varepsilon\\ w^{T}\phi(x_{i})+b-y_{i}\leq\varepsilon\end{array}\right.,i=1,\ldots,l\end{array}  \tag{1}\]  
when solving \(w\) and \(b\), the standard online SVR algorithm considers the same scale for error items, this results in poor prediction of stream data items with different variance of error items \(\delta_{i}^{2}\). To solve this problem, the paper introduces an appropriate weight \(\lambda_{i}\) to adjust the role of each error item in regression. In addition, the standard online SVR uses the same insensitive loss \(\varepsilon\) for all data points. However, the timeliness of streaming data is very strong, the new data is more instructive than the old data, different samples should use different \(\varepsilon\). In this paper, \(\varepsilon\) of each data uses different weights \(\left(1-d\right)^{i}\), the relaxation factor \(\tau_{i}\geq 0\) and \(\tau_{i}^{*}\geq 0\) as well as the weight \(\lambda_{i}\)\(=1/\delta_{i}^{2}\) and \(p^{i}\) are introduced to solve \(w\) and \(b\):  
\[ \begin{array}{c}\min\frac{1}{2}\|w\|^{2}+C\sum\limits_{i=1}^{l}\lambda_{i}( \tau_{i}+\tau_{i}^{*})\\ s.t.\left\{\begin{array}{l}y_{i}-w^{T}\phi(x_{i})-b\leq p^{i}\varepsilon+ \tau_{i}\\ w^{T}\phi(x_{i})+b-y_{i}\leq p^{i}\varepsilon+\tau_{i}^{*}\end{array}\right.,i= 1,\ldots,l\end{array}  \tag{2}\]  
where \(C\) is the penalty parameter, \(\varepsilon\) is the insensitive loss function, \(d\) is the change factor between 0 and 1. the weights \(p^{1}\) correspond to the data furthest from the prediction point, and \(p^{i}\) correspond to the data closest to the prediction point. The Lagrange multiplier method is used to solve the formula (2). First, the constraint conditions are fused into the target function by the Lagrange function, and the Lagrange equation is obtained. \[ \begin{array}{c}L(w,b,\alpha,\alpha^{*},\beta,\beta^{*})=\frac{1}{2}\|w\|^ {2}+C\sum\limits_{i=0}^{l}\lambda_{i}(\tau_{i}+\tau_{i}^{*})-\sum\limits_{i= 1}^{l}\left(\beta_{i}\tau_{i}+\beta_{i}^{*}\tau_{i}^{*}\right)+\sum\limits_{i= 1}^{l}\alpha_{i}(w^{T}\phi(x_{i})-p^{i}\varepsilon-y_{i}-\tau_{i})\\ +\sum\limits_{i=1}^{l}\alpha_{i}^{*}(y_{i}-w^{T}\phi(x_{i})-p^{i}\varepsilon- \tau_{i}^{*})\end{array}  \tag{3}\]  
Here, \((\alpha,\alpha^{*},\beta,\beta^{*})\geq 0\) is the Lagrange multiplier.