# Fault Diagnosis of a Reconfigurable Crawling-Rolling Robot Based on Support Vector Machines
## 4 Support Vector Machine (SVM)
**c-Support Vector Classification (c-SVC):**  
In c-SVC, C is the regularization parameter. The value c ranges from zero to infinity. Given a two-class classification problem (x\({}_{i}\), y\({}_{i}\)) [23], where x\({}_{i}\) is the training data, x\({}_{i}\)\(\in\) R\({}^{n}\) for i = 1,2,... 1, y\({}_{i}\), is the training label, and y\({}_{i}\)\(\in\) {+1, \(-1\)} for all y \(\in\) R\({}^{l}\), c-SVC solves the following primal optimization problem  
\[\min_{\mathrm{w},\mathrm{b},\mathrm{\_}{\mathrm{\_}{\mathrm{\_}{\mathrm{ \_}{\mathrm{\_}{\mathrm{\_}{\mathrm{\_}{\mathrm{\_}{\mathrm{\mathrm{\}}}}}}}}}}} }\frac{1}{2}\mathrm{w}^{\mathrm{T}}\mathrm{w}+\mathrm{C}\sum_{i=1}^{l}\xi_{i} \tag{10}\]  
subject to y\({}_{i}\)(w\({}^{\mathrm{T}}\varphi\)(x\({}_{i}\)) + b) \(\geq 1-\xi_{i}\) and \(\xi_{i}\geq\)0. Figure 5: Standard Support Vector Machines Classifier. The training data is \(x_{i}\) is mapped into a higher dimensional space by \(\varphi(x_{i})\). This is done to provide a good classification in the case of nonlinear training data. We also need to solve the following dual problem. \[\min_{\alpha}\ \frac{1}{2}\alpha^{T}Q\alpha-e^{T}\alpha \tag{11}\]  
subject to \(y^{T}\alpha=0\) and \(0\leq\alpha_{i}\leq C\). Where \(e=[\ 1,\ \ \ldots\ \,1\ ]\)  
Q is a positive semidefinite matrix, and \(Q_{ij}=y_{i}y_{j}K(x_{i},\ x_{j})\). The decision function obtained is characterized by  
\[sgn(w^{T}\varphi(x)+b)=sgn(\sum_{i=1}^{1}y_{i}\alpha_{i}K(x_{i},x)+b) \tag{12}\]  
**v-Support Vector Classification (v-SVC):**  
In this Support vector classification, the variable \(v\) is taken as the regularization parameter, and it ranges from 0 to 1. Given a two-class classification problem (\(x_{i},\ y_{i}\)) where \(x_{i}\) is the training data and \(x_{i}\)\(\epsilon\)\(R^{n}\), \(i=1,2,\ldots\) 1. \(y_{i}\) is the training label and \(y_{i}\)\(\epsilon\)\(\{+1,\ -1\}\), \(y\)\(\epsilon\)\(R^{l}\), \(v\)-SVC solves the following primal optimization problem  
\[\min_{w,b,\ PS,\rho}\ \frac{1}{2}w^{T}w-v\rho+\frac{1}{1}\sum_{i=1}^{1}\xi_{i} \tag{13}\]  
subject to \(y_{i}(w^{T}\varphi(x_{i})+b)\geq\rho-\xi_{i}\) and \(\xi_{i}\geq\)0, \(\rho\geq\)0. The dual problem in \(v\)-SVC is  
\[\min_{\alpha}\ \frac{1}{2}\alpha^{T}Q\alpha \tag{14}\]  
subject to \(y^{T}\alpha=0\), \(0\leq\alpha_{i}\leq 1/1\) and \(e^{T}\alpha\geq v\). where \(Q_{ij}=y_{i}\ y_{j}\ K(x_{i},\ x_{j})\). The final decision function is  
\[sgn\left(\sum_{i=1}^{1}y_{i}\alpha_{i}K(x_{i},x)+b\right) \tag{15}\]  
In addition to using two different types of SVM, we have used two different kernels for each type of SVM. The two kernels are the linear and radial basis function. The linear kernel is optimal in cases when the training and testing data are linearly separable. The data are linearly separable if a single decision boundary line provides the necessary separation for classifying the data. The linear kernel is characterized by  
\[\mathrm{W}^{\mathrm{T}}\mathrm{x}+\mathrm{b}=0. \tag{8}\]0  
If the data is nonlinear, then the radial basis function kernel is a better option. This kernel maps the data into a higher dimensional space; thus, provides a better classification for nonlinear data than the linear kernel. The radial basis function kernel is characterized by  
\[\mathrm{W}^{\mathrm{T}}\mathrm{x}+\mathrm{b}=0. \tag{8}\]1