## 2 Materials and Methods
### Multivariate Analysis  
#### 2.4.1 Calibration Models  
To build calibration models for chlorogenic acid, luteolin-7-O-glucose, and 3,5-O-dicaffeoylquinic acid content determination, partial least squares (PLS), extreme learning machine (ELM), and least-squares support vector machine (LS-SVM) were used. PLS is the most widely used chemometric method in spectral data analysis. PLS has the advantage of dealing with the large amount of data efficiently and computing quickly. PLS explores the linear relationship between the spectral variables (\(X\)) and the response variable (\(Y\)) [15]. The procedure of PLS can be summarized as follows:  
(1) Decompose the X and Y simultaneously as:  
\[X=SxLx+Ex \tag{1}\]  
\[Y=SyLy+Ey \tag{2}\]  
where \(Sx\) and \(Sy\) are the scores of \(X\) and \(Y\), respectively; \(Lx\) and \(Ly\) are the loadings of \(X\) and \(Y\), respectively; \(Ex\) and \(Ey\) are the residual errors of \(X\) and \(Y\), respectively. \(X\) and \(Y\) are decomposed into different principal components (called latent variables, LVs). (2) Calculate the correlation coefficient matrix between \(Sx\) and \(Sy\) of each LV:  
\[Sy=CSx \tag{3}\]  
\[C=SxSy(SxSy)^{-1} \tag{4}\]  
where \(C\) is the correlation coefficient matrix. \(Sx\) and \(Sy\) should contain as much information of \(X\) and \(Y\) as possible, and they should be maximally correlated. The optimal number of LVs is important for the PLS model, and the PLS model with optimal number of LVs should have the best performance. ELM  
ELM is one kind of feedforward neural network. ELM has the advantage of good generalization ability and fast computing. For ELM training, only the number of neurons in the hidden layer needs to be defined. The input weights and bias are randomly initialized. The output of ELM is determined by the activation function [16]. The procedure of ELM can be summarized as follows:  
(1) Given spectral variables (\(X\)) and the response variable (\(Y\)), \(X\) is an \(N\times P\) matrix, and \(Y\) is an \(N\times 1\) matrix. The number of neurons in the hidden layer is set as \(m\), the weights between the input layer and the hidden layer are randomly generated as \(W\), the bias matrix of the neurons in the hidden layer \(b\) is randomly generated, \(\beta\) is the output weight matrix. The ELM model can be simply described as:\[Yout_{j}=\sum_{i=1}^{m}\beta_{i}f\Big{(}W_{i}X_{j}+b_{i}\Big{)},j=1,2,3,\ldots,N \tag{5}\]  
where \(Yout_{j}\) is the output, \(f(X)\) is the activation function. (2) The training procedure is to minimize the error between the output and the \(Y\) to be 0, which is:  
\[min\|Yout_{j}-Y_{j}\|,j=1,2,3,\ldots,N \tag{6}\]  
In ELM, the problem arises of finding the optimal output weight matrix \(\beta\) to achieve the goal of Equation (6). The optimal \(\beta\) can be obtained by finding the least-squares solution of Equation (6). In this study, Sigmoid function was used as the activation function. LS-SVM  
LS-SVM is an efficient machine learning method extended from the general SVM. Unlike SVM, which solves a convex quadratic programming problem for optimization, LS-SVM tries to solve a set of linear equations instead. LS-SVM has characteristics such as good generalization ability and fast computing. Based on SVM, kernel function is also the key factor for LS-SVM [17]. The procedure of LS-SVM can be summarized as follows:  
(1) Given spectral variables (\(X\)) and the response variable (\(Y\)), \(X\) is an \(N\times P\) matrix, and \(Y\) is an \(N\times 1\) matrix. The LS-SVM function estimation is to minimize the following function:  
\[C=\frac{1}{2}W^{T}W+\gamma\sum_{i=1}^{N}e_{i}^{2} \tag{7}\]  
where \(W\) is the weight, \(e\) is the error, \(\gamma\) is an adjustable parameter.