## 5 Support Vector Regression
where \(b\) is the mean of all possible \(b\) values for the support vectors when \(-\alpha_{i}+\alpha_{i}^{*}\
eq 0\), using Karush-Kuhn-Tucker (KKT) conditions [26; 27; 28]. \[b=\frac{1}{|S|}\sum_{s\in S}\left(y_{s}+\epsilon-\sum_{i=1}^{m}\left(-\alpha_{ i}+\alpha_{i}^{*}\right)\mathbf{r}_{i}^{T}\mathbf{x}_{s}\right) \tag{15}\]  
Here, \(S\) is the subscript set such that \(\alpha_{j}\) is greater than 0, given by \(S=\left\{j\big{|}\alpha_{j}\right\}0,j=1,2,\ldots,m\right]\). For real-world problems, it is impossible to find such a hyperplane that satisfies both good flatness and fitness simultaneously. One possible approach is to find a hypersurface \(f(\mathbf{x})=\mathbf{\omega}^{T}\phi(\mathbf{x})+b\), which preprocesses sample \(\mathbf{x}\) into a feature space by a mapping \(\phi(\mathbf{x})\). With the help of the kernel function method, the solution of nonlinear SVR is given by  
\[f(\mathbf{x})=\sum_{i=1}^{m}\left(-\alpha_{i}+\alpha_{i}^{*}\right)K(\mathbf{x},\mathbf{x }_{i})+b \tag{16}\]  
where \(K(\mathbf{x},\mathbf{x}_{i})\) is the kernel function, and \(b\) is similar to Equation (15), although \(\mathbf{x}_{i}^{T}\mathbf{x}_{s}\) is substituted by \(K(\mathbf{x}_{i},\mathbf{x}_{s})\). Linear kernel \(K(\mathbf{x},\mathbf{x}_{i})=\mathbf{x}^{T}\mathbf{x}_{i}\) and Gaussian kernel \((\mathbf{x},\mathbf{x}_{i})=\exp\left(-\gamma\|\mathbf{x}-\mathbf{x}_{i}\|^{2}\right)\), where \(\gamma\) is a parameter representing the width of Gaussian kernel, are widely used as kernel functions for most SVRs. To choose the best SVR model, parameter \(C\) for linear kernel and parameters \((C,\gamma)\) for a Gaussian kernel need to be selected. A simple grid search, with grids from \(2^{-9}\) to \(2^{9}\) for \(C\) and \(2^{-8}\) to \(2^{2}\) for \(\gamma\), both in interval \(2^{1}\), is used to select model parameters. To reduce overfitting, there are several strategies for model selection, such as hold-out, bootstrap, and \(n\)-fold cross-validation [27]. For a dataset with small size samples, the simple and powerful strategy is \(n\)-fold cross validation, which divides the dataset into \(n\) mutually exclusive and complementary subsets, and each time uses \(n-1\) subsets as training sets and the remaining subset as the testing set. The best parameters are selected by choosing the model that gives the minimum average mean squared error (MSE) for the all \(n\) subsets. Besides the MSE and correlation coefficient, accuracy percentage is proposed to evaluate the performance of regression model. Accuracy percentage (\(P_{a}\)) is defined as the number of correctly predicted data, when the rounded value of predicted MSI equals to actual MSI, divided by the number of testing data:  
\[P_{a}=\frac{\left|\left\{i\big{|}\text{{round}}(f(\mathbf{x}_{i}))=y_{i},i=1, 2,\ldots,I\big{|}\right\}}{l}\times 100\% \tag{17}\]  
where _round_ is a function that rounds the element to the nearest integer, and \(I\) is the total number of testing data. Since the accuracy percentage is based on the condition that the prediction value is within MSI \(\pm\) 0.5, the deviation \(\epsilon\) is set to 0.5 for the SVR. The procedure of SVR for establishing the relationship between MSI and ground motion parameters are summarized as follows: (1) choosing some ground motion parameters as features; (2) making logarithmic transformation on ground motion parameters, except for the destructive index; (3) scaling the chosen features linearly to the range of \([-1,+1]\); (4) selecting optimal regularization constant \(C\) and kernel parameter \(\gamma\) for the regression model, using 10-fold cross-validation on the training dataset; and (4) assessing the performance of regression on the testing dataset. Support vector machine toolbox LIBSVM, developed by [PERSON] and [PERSON] [28], was used to perform the training and testing.