# Estimation of Free Fatty Acids in Stored Paddy Rice Using Multiple-Kernel Support Vector Regression
## Materials and Methods
### Support Vector Regression  
Support vector machine (SVM) is an ML algorithm which is a discriminative classifier proposed for binary classification problems and is based on statistical learning theory [26; 36]. Given the training set \(S\)= {(\(\mathbf{x}_{1},y_{1})\),..., (\(\mathbf{x}_{m},y_{m})\)} of points \(\mathbf{x}_{i}\in\Re^{d}\) with the corresponding labels \(y_{i}\in\{-1,+1\}\), SVM classifiers attempt to find a classification hyperplane induced from the maximum margin principle and predicted to belong to a category based on the side of the gap on which they fall. Similar to SVM classification, the basic concept of SVM regression is to nonlinearly map the original data \(\mathbf{x}\) into a high-dimensional feature space, and to solve a linear regression problem in this feature space. In a regression problem, each \(y_{i}\) is the desired target, or output, value for the input vector \(\mathbf{x}_{i}\). Figure 5: Moisture content changes of grain during storage. The value of each point is the average of the 18 positions in the layer. For SVR, a margin of tolerance (_epsilon_) is set in approximation to the SVM which would have already requested from the problem [37; 38]. The regression function is expressed as:  
\[f(\mathbf{x})=\left\langle\mathbf{w},\phi(\mathbf{x})\right\rangle+b, \tag{2}\]  
where \(\left\langle.,.\right\rangle\) indicates the inner product of the involved arguments, \(\mathbf{w}\) is the weight vector, \(\phi(\mathbf{x})\) is the nonlinear mapping function, and \(b\) is the threshold. Based on the principle of minimizing the regularized risk, the objective function and constraints for SVR can be defined as follows:  
\[ \begin{array}{l}\underset{\mathbf{w},b,\hat{\xi}_{i},\hat{\xi}_{i}}{\min} \frac{1}{2}\langle\mathbf{w},\mathbf{w}\rangle+C\sum\limits_{i=1}^{l}\left( \xi_{i}+\hat{\xi}_{i}\right),\\ \text{s.t.}\left\{\begin{array}{l}\left(\left\langle\mathbf{w},\phi(\mathbf{ x}_{i})\right\rangle+b\right)-y_{i}\leq\varepsilon+\xi_{i}\\ y_{i}-\left(\left\langle\mathbf{w},\phi(\mathbf{x}_{i})\right\rangle+b\right) \leq\varepsilon+\hat{\xi}_{i}\\ \xi_{i}\geqslant 0,\hat{\xi}_{i}\geqslant 0,\;i=1,\ldots,l\end{array}\right.\end{array}  \tag{3}\]  
where \(C\) is a parameter which adjusts the tradeoff between the regression error and the regularization on \(f\), \(l\) is the number of training patterns, \(\xi_{i}\)(\(\hat{\xi}_{i}\)) is slack variables allowing for errors around the regression function, and \(\varepsilon\geq 0\) is the parameter in the \(\varepsilon\)-insensitive loss function and controls the accuracy of the regressor. By adding Lagrangian multipliers \(\alpha,\hat{\alpha}\), the quadratic programming problem can be optimized as a dual problem. Then, the dual problem of Equation (3) can be written as  
\[ \begin{array}{l}\underset{\alpha,\hat{\alpha}}{\max}&\sum\limits_{i=1}^{l}y _{i}(\hat{\alpha}_{i}-\alpha_{i})-\varepsilon\sum\limits_{i=1}^{l}(\hat{ \alpha}_{i}+\alpha_{i})\\ &-\frac{1}{2}\sum\limits_{i=1}^{l}\sum\limits_{j=1}^{l}(\hat{\alpha}_{i}- \alpha_{i})\left(\hat{\alpha}_{j}-\alpha_{j}\right)K\left(\mathbf{x}_{i}, \mathbf{x}_{j}\right)\\ \text{s.t.}&\sum\limits_{i=1}^{l}(\hat{\alpha}_{i}-\alpha_{i})=0\\ &C\geqslant\alpha_{i},\hat{\alpha}_{i}\geqslant 0,\;i=1,\ldots,l\end{array}  \tag{4}\]  
where \(\alpha=\{\alpha_{1},\ldots,\alpha_{l}\}\) and \(\hat{\alpha}=\{\hat{\alpha}_{1},\ldots,\hat{\alpha}_{l}\}\) are the dual variables, and \(K(\mathbf{x}_{i},\mathbf{x}_{j})\) is a kernel function which represents the inner product \(\left\langle\phi(\mathbf{x}_{i}),\phi(\mathbf{x}_{j})\right\rangle\). The sequential minimal optimization (SMO) [39] algorithm can be used to solve Equation (4).