## 3 Results
### Predictive Models  
The partial least square (PLS) regression method was used to build predictive models using 2020 and 2021 datasets together to try to better verify the predictive capability. The only pre-treatment that was performed on the data was autoscaling; by dividing the variables into their respective standard deviations, it is possible to give each variable the same importance by imposing equal weights in the analysis [26,27].  
The prediction capability of the PLS models was verified by calculating the parameters to evaluate it, both in cross-validation and in prediction. Table 2 shows the figure of merit of the three predictive models built by considering two latent variables (LVs).  
The most efficient model is the model for TSS prediction (R\({}^{2}\) in cross-validation = 0.88 and in prediction = 0.87) and secondary, the model for TA prediction (R\({}^{2}\) in cross-validation = 0.83 and in prediction = 0.80). The least performing model is the one built for the prediction of the pH with a R\({}^{2}\) in cross-validation of 0.56 and in prediction of 0.62. Maturation curves, which represent the measured and predicted (through the use of PLS models) values for each qualitative parameter, were created. For the creation of the curves, the average values for each sampling date were calculated to be compared with the average values obtained using the device.  
The maturation curves that represent the 2020 data show more evident differences between the reference values measured by wet-chem analyses (in red color) and the values predicted by the model (in blue color). The performance improvement of the models for the prediction of the three qualitative parameters is to be attributed to the innovative structure of the prototype, which, as already mentioned, has been modified with respect to the original device in pre-prototype form that did not have the two sensors integrated in a single instrument. The integration of the two sensors in a single hardware allowed for better performance in terms of efficiency of light transfer, both from the LED to the agri-food product and from the grapes to the photodiode, i.e., a better signal to noise ratio [28].  
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Parameter** & **LVs** & **Treatment** & **SD \({}^{*}\)** & **R2 CV** & **RMSECV** & **R2 Pred** & **RMSEP** & **RPD** \\ \hline TSS & 2 & autoscaling & 5.35 & 0.88 & 1.84 & 0.87 & 1.90 & 2.81 \\ \hline pH & 2 & autoscaling & 0.26 & 0.56 & 0.18 & 0.62 & 0.14 & 1.85 \\ \hline TA & 2 & autoscaling & 8.85 & 0.83 & 3.59 & 0.80 & 3.94 & 2.25 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Figure of merit of the partial least square (PLS) models calculated with two latent variables, using optical data pretreated with autoscaling.  
Figure 4: (**a**) Scores plot of PC1 and PC3, labelled according to TSS content and relative loadings plot; (**b**,**c**) loadings plot of PC2.  
The test carried out a comparison between the values of the qualitative parameters measured in the laboratory (reference parameters) and the values predicted by the device, i.e., the values obtained from the PLS predictive models. The values were compared for each qualitative parameter and for both sampling years, and for each sampling time. The results demonstrated that the integrated version of the prototype (2021) provides more accurate quality parameters estimation than the pre-prototype version used in 2020 sampling. This phenomenon is highlighted by the non-significative differences (n.s.) in the 2021 comparisons, e.g., for TA and pH, no sampling time shows differences between the reference and predicted values.