## 3 Results  
### Detection of Adulterated Egg Pasta Samples  
NIR spectra were collected for all the available samples as described in Section 2.2; average spectra for \"Class Conformant\" (blue line) and \"Class Adulterated\" (red line) are shown in Figure 1. The mean raw spectra for the two categories look alike (Figure 1a); even after the 1 st derivative (Figure 1b) no relevant differences could be observed. In order to perform external validation of the classification model, samples were divided into calibration (training) and validation (test) set by the Duplex algorithm [20]; more details are reported in Table 2.  
Training samples were used to define model parameters (number of latent variables (LVs) and the optimal data pretreatment) into a 7-fold cross-validation procedure; test objects were left out as external validation set and used to estimate the reliability of the calibration model. Different preprocessing approaches (aimed at removing possible uninformative information) were tested; pretreated data were used to build PLS-DA models and then the most suitable solution was defined on the basis of the Correct Classification Rate in Cross-Validation (%CV). Tested pretreatments were: mean centering, 1 st and 2 nd derivative (following the Savitzky-Golay approach with a 19 points window and a third order interpolating polynomial [21]), Standard Normal Variate (SNV) [22], Multiplicative Scatter Correction (MSC) [23] and their combination (see Table 3). From Table 3, it was evident that the PLS-DA model providing the highest correct classification rate in cross-validation was the one built on data preprocessed by MSC (Model VII), which \begin{table}
\begin{tabular}{c c c c c} \hline \hline \(\mathbf{x}\) & \multicolumn{2}{c}{**Calibration Set**} & \multicolumn{2}{c}{**Validation Set**} \\ \hline  & \multicolumn{2}{c}{**Class**} & \multicolumn{2}{c}{**Class**} & \multicolumn{2}{c}{**Class**} \\  & \multicolumn{2}{c}{**Law-Conformant**} & \multicolumn{2}{c}{**Adulterated**} & \multicolumn{2}{c}{**Law-Conformant**} & \multicolumn{2}{c}{**Adulterated**} \\ \hline
**No. of samples** & 17 & 43 & 7 & 33 \\
**Total samples** & & 60 & & 40 & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Division of samples into calibration and validation sets. Figure 1: (**a**) Average raw spectra and (**b**) average spectra after the 1 st derivative. Legend: “Class Conformant”: blue line and “Class Adulterated”: red line. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multirow{2}{*}{**Pretreatment**} & \multirow{2}{*}{**LVs**} & \multicolumn{2}{c}{**Correct Classification Rate in**} \\  & & & \multicolumn{2}{c}{**Cross-validation (\%)**} \\ \cline{5-5}  & & & **Class Law-Conformant** & **Class Adulterated** \\ \hline Model I & Mean Centering (MC) & 3 & 100.0 & 83.7 \\ Model II & 1 st derivative (+MC) & 4 & 94.1 & 88.4 \\ Model III & 2 nd derivative (+MC) & 9 & 76.5 & 100.0 \\ Model IV & SNV (+MC) & 8 & 100.0 & 90.7 \\ Model V & SNV+1 st derivative (+MC) & 4 & 94.1 & 93.0 \\ Model VI & SNV+2 nd derivative (+MC) & 9 & 70.6 & 100.0 \\ Model VII & MSC (+MC) & 9 & 100.0 & 95.3 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Partial Least Squares Discriminant Analysis (PLS-DA) results on the calibration set. provided a total classification rate of 97.65%. Consequently, this model was used to predict the test samples and it provided correct classification rates of 100% and 97% for \"Class Conformant\" \"Class Adulterated\", respectively. A graphical representation of these results is displayed in Figure 2, where the values of the predicted response for both the training and the test samples are shown. In the plot, the black dashed line is the delimiter between the two categories: a sample fallowing above it will be assigned by the model to \"Class Conformant\", while the objects below the delimiter are predicted as belonging to \"Class Adulterated\". In the plot, all the analyzed samples are displayed: both the calibration (empty symbols) and the validation (full symbols) objects.