## 3 Results
### PLS-DA Analysis of NIR Spectra Collected on the Kernel  
As discussed before, after measuring the shellnut, each walnut was opened and NIR spectra were collected on the kernels. Mean spectra for samples belonging to Class Sorrento (red line) and Class Non-Sorrento (blue line) are reported in Figure 4. Moreover, in this case, it is not possible to appreciate a significant difference between the spectra collected on samples belonging to the two categories.  
PLS-DA analysis was carried out following the same procedure used for spectra collected on the nutshell. Consequently, different pretreatments were tested, and the optimal pretreatment and complexity to build the final calibration model were selected on the basis of smallest average classification error in cross validation. The results from this part of the analysis are summarized in Table 3.  
The PLS-DA model providing the lowest average classification error is the one built on data preprocessed by 1 st derivative. Consequently, this pretreatment was considered the most suitable for the investigated data. When the calibration model was used to predict test samples, it correctly classified all Class Sorrento objects (i.e., 100% of sensitivity) with a specificity of 93.8%, and it misclassified two  
Figure 4: Average raw spectra collected on Sorrento (blue line) and Non-Sorrento (red line) walnuts (kernel).  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Pre-Treatment** & **LVs** & **Average Classification Error (\%CV)** \\ \hline Mean Centering (MC) & 10 & 2.8 \\
1 st derivative (+ MC) & 12 & 1.6 \\
2 nd derivative (+ MC) & 10 & 4.1 \\ SNV (+ MC) & 10 & 7.1 \\ SNV+ 1 st derivative (+ MC) & 12 & 2.8 \\ SNV+ 2 nd derivative (+ MC) & 10 & 2.8 \\ \hline \hline \end{tabular}
\end{table}
Table 3: PLS-DA modeling of the spectra collected on the kernel: results of cross-validation (LVs: Latent variables).  
(out of 32) Non-Sorrento samples (corresponding to a sensitivity of 93.8%), the specificity being 100%, due to the symmetry of the classification results for a two-class problem.  
The predicted **y** is displayed as a function of the sample index in Figure 5. The plot is quite self-explanatory. As before, samples associated to a **y** higher than the threshold are predicted as belonging to Class Sorrento (otherwise, they are predicted as Class Non-Sorrento). From the figure, it is clear only two samples are misclassified: two Non-Sorreto samples (blue squares) predicted as belonging to Class Sorrento (red diamonds).  
VIP analysis was run also on this model. The variables identified as important were in agreement with the ones discussed in Section 3.1; consequently, they will not be discussed again here, but they are shown in Figure A1 in Appendix A.  
Comparing the predictions provided by the PLS-DA models built on spectra collected on the nutshell and on the kernel, it can be observed how one of the misclassified samples (belonging to Class Non-Sorrento) was wrongly predicted by both models. This is not completely surprising because, as detailed in Table 1, some Non-Sorrento walnuts are Italian, so they could have been harvested in an area nearby Sorrento or in a town presenting similar pedoclimatic conditions.