## 2 Materials and Methods
### Data Analysis Methods  
Principal component analysis (PCA) is a widely used data reduction and feature extraction method. PCA projects the original variables into new orthogonal variables (called principal components, PCs) in the new data space, and each PC is a linear combination of the original variables. The PCs are ranked according to the explained variances. In general, the first few PCs contain most of the information, and these PCs are used to represent the original data. PCA is generally used to qualitatively explore the separability and clusters of samples by projecting one PC on the other PC in the scores space. For hyperspectral images, PCA can be used to obtain pixel-wise score values to form score images at different PCs. To obtain score images, one hyperspectral image of each class was used. After background removal, pixel-wise spectra within sample regions were extracted. PCA was conducted on the pixel-wise spectra to obtain pixel-wise score values at different PCs. For each hyperspectral image, the corresponding score images at different PCs are obtained by knowing the pixel-wise score values. In other words, these score images are the products of the PCA scores. In the PCA score images, score values can be presented in color gradients, and differences among samples are observed [23; 24].  
Support vector machine (SVM) is a widely used pattern recognition algorithm in spectral data analysis [25; 26]. For a linearly separable issue, SVM explores a set of hyperplanes to maximize the distance among the closest samples from different classes. For samples which are not linearly separable, SVM maps the original data into higher dimension spaces to make the samples linearly separable. In the new space, SVM explores a set of hyperplanes to maximize the distance among the closet samples from different classes. Kernel functions are important for SVM to map the data. In spectral data analysis, radial basis function (RBF) is the most widely used kernel function, due to its strong ability to deal with nonlinear issues. In this study, RBF was used as the kernel function. The parameters of SVM (penalty coefficient C and kernel width g) were determined by a grid-search procedure. For SVM models, the category values of Longjing tea from Bashan Village, TongWu Village, Meijiawu Village, Tiedian Village, Xinxin Village, and Huijaling Village were coded as 1, 2, 3, 4, 5, and 6, respectively.  
Partial least squares discriminant analysis (PLS-DA) is one of the most used discriminant methods in spectral data analysis [27]. PLS regression tries to find the maximum correlation between the dependent variable and the independent variables. PLS-DA is conducted in the same way as PLS regression (PLSR), and PLS-DA uses integers or dummy variables which represent the sample classes as dependent variables. To establish the optimal PLS-DA model, the optimal number of latent variables (LVs) of PLS-DA is determined. For PLS-DA models, the category values of Longjing tea from Bashan Village, TongWu Village, Meijiawu Village, Tiedian Village, Xinxin Village, and Huijaling Village were coded as 000001, 000010, 000100, 01000, and 100000, respectively. In this study, both SVM and PLS-DA models were built using full spectra.