## 1 Introduction
addressed the problem of damage caused by insect feeding in chestnut trees, achieving very low classification error rates, with 16.81% false negatives, 0.00% false positives, and a total error of 8.41% [31]. [PERSON] et al. approached the problem of detecting insect infestation in mango fruits achieving a total explained variance of 99% using only two principal components [18]. [PERSON] et al. explored Vis/NIR spectroscopy to detect pomeranate fruits with internal infestation caused by caro moth (_Etcompelois ceratoniae_) larvae, showing an overall classification rate of 90.6% [15]. [PERSON] et al. used visible and near-infrared spectroscopy (550 to 950 nm) to identify internal insect infestation in cherries, achieving an 85.0% classification accuracy [32]. [PERSON] et al. developed a Vis/NIR spectroscopy system to analyze the location of _Bactrocera dorsalis_ infestation in citrus at different stages of infestation achieving 95.2%, 80.1%, and 100% accuracy for not infested, lightly infested, and severely infested citrus, respectively [33]. More recently [34], [PERSON] et al. developed a model to classify infestation in wild apple trees achieving a model specificity and accuracy of 96.32% and 95.94%, respectively. However, with regard to the use of spectroscopy for the detection of internal insect infestation in fruits, the results depend on the type and stage of fruit ripening, type and age of the insect, and level of fruit damage or insect infestation [28], as well as on the spectrum acquisition conditions, such as the orientation of the light source [33]. In general, the spectrophotometric models are obtained by constructing a statistical chemometric model able to extract information from the sample's spectrum [23]. However, as spectrophotometric data are influenced by many factors producing different effects, it is difficult to assess the correlation between the spectra and the parameter of interest; therefore, the correlation needs to be quantified, from the statistical point of view, assessing the model prediction error on unknown samples [35] (i.e., samples that have not been used in the building of the statistical model). Some algorithms widely used for this aim are: principal components regression (PCR), relying on the singular values decomposition factorization along the maximum variance axes, proposed in 1901 by [PERSON] [36], and partial least squares regression (PLS), developed in 1975 by [PERSON] and [PERSON] [37; 38]. PLS builds the model using as new variables the decomposition in spectral scores and loading matrices. To estimate the prediction error, the cross-validation (CV) technique is used [39; 40; 41]. In general, the so-called k-fold CV allows the estimate of the prediction performance--assessed by the coefficient of determination (R2P) on unknown samples--through the measure of the coefficient of determination of CV (R2 CV), being widely accepted as a statistical estimate of R2P. However, the ability of the model to predict unknown samples should be assessed through the external cross-validation set (EXTCV), directly measuring the R2P; but, the external validation set is rarely used: it consists of taking apart a subset of the samples (expressed as a percentage of the overall samples, generally 20-30%) and using it to verify and measure the true prediction ability of the model on truly unknown samples. Furthermore, some wavelengths negatively affect the model performance [42], impeding the achievement of a suitable predictive error. To address this problem, the method of the \"coefficient of variation algorithm\" (CVA) was developed. CVA allows for the identification of the interfering wavelengths bringing to spectrophotometric models of great predictive performance [43; 44; 45]. The use of k-fold CV involves k estimates of the model coefficients; CVA is related to the observation that the final model arises from the mean of these k estimates of the coefficients.