## 2 Materials and Methods
### Support Vector Machine (SVM)  
SVM is a nonparametric method that maps the features into a higher-dimensional space and creates a separable hyperplane based on the Gram matrix of the kernel functions [36]. In the current study, four computationally kernels were adopted: Radial Basis Function (RBF, Equation (4)), Polynomial (Equation (5)), Gaussian (Equation (6)), and Pearson Universal Kernel (Equation (7)). \[f(xy)=e^{-x\left\|x-y\right\|^{2}} \tag{4}\]  
\[f(xy)=\frac{\left[\left(xy+1\right)^{n}\right]}{\sqrt{\left(xy+1\right)^{n} \left(y^{2}+1\right)^{n}}} \tag{5}\]  
\[f(xy)=exp\left(-\frac{\left\|x_{i}-x\right\|^{2}}{2\sigma^{2}}\right) \tag{6}\]\[f(xy)=\frac{1}{\left[1+\left(2\sqrt{\|x-y\|^{2}\sqrt{2^{\frac{1}{\beta}}-1}}\right) ^{2}\right]^{\beta}} \tag{7}\]  
where \(\alpha\) is the kernel size, \(x\) and \(y\) are feature vectors, \(n\) stands for the polynomial order, and \(\sigma\) and \(\beta\) specify the gaussian functions. In order to achieve a good performance of the Polynomial and Gaussian kernel functions, it is important to perform an appropriate regularization of the penalty factor (C). This also impacts the performance of SVM by testing how well the model fits the training data. Moreover, the regularization coefficient (\(\gamma\)) sets the extent to which the data are transformed into a higher-dimensional space by scaling the spread of the RBF and Pearson kernels. In this work, 5 levels of C (0.01, 0.1, 1, 10, and 100) and 3 levels of \(\gamma\) (0.01, 0.1, and 1) were used to find a suitable location of the hyperplanes. The model was then evaluated in an iterative manner until optimal results were obtained. A summary of the data analysis is presented in Table 1. The table outlines the spectral preprocessing techniques and the corresponding models applied to predict quality parameters (SSC and firmness) and to classify ripening stages of kiwifruit. Detailed kernel types, model configurations, and training parameters are also reported where applicable. Performance Analysis of the Classification Model  
A comparison between the utilized models to select the best model for the developed system was applied. The criteria were the correlation coefficient (R), mean absolute error (MAE), and root mean squared error (RMSE), which were measured by the following equations:  
\[\text{R}=\sqrt{1-\frac{\sum_{i=1}^{n}\left(C_{i}-C_{ii}\right)^{2}}{\sum_{i=1}^ {n}\left(C_{i}-C_{m}\right)^{2}}} \tag{8}\] \begin{table}
\begin{tabular}{c l l} \hline \hline  & **Models** & **Abbreviation/Details** \\ \hline
**Prediction task** & Partial Least Squares Regression (PLSR) & Raw-PLS \\ \hline  & Standard Normal Variate + PLSR & SNV-PLS \\ \hline  & Multiplicative Scatter Correction + PLSR & MSC-PLS \\ \hline  & Savitzky–Golay 1 st derivative + PLSR & SG1-PLS \\ \hline  & Savitzky–Golay 2 nd derivative + PLSR & SG2-PLS \\ \hline
**Classification task** & Linear Discriminant Analysis (LDA) & \\ \hline  & Decision Trees (DT) & \(\bullet\) & **J48—**Based on C4.5 algorithm \\  & & \(\bullet\) & **CART—**Classification and Regression Trees \\  & & & Trees \\  & & \(\bullet\) & **LMT—**Logistic Model Tree \\ \hline  & Artificial Neural Network (ANN) & 2 hidden layers, 20 neurons per layer; odd-odd or even-even configuration; \\  & & Levenberg–Marquardt training. \\ \hline  & & Kernels = Radial Basis Function (RBF), \\  & Support Vector Machine (SVM) & Polynomial, Gaussian, Pearson Universal; \\  & & Regularization parameters: C = {0.01, 0.1, 1, 10, 100}, \(\gamma\) = {0.01, 0.1, 1} \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Summary of preprocessing methods and machine learning models used for prediction and classification tasks. \[\text{MAE}=\frac{1}{n}{\sum_{i=1}^{n}}{|C_{i}-C_{ii}|} \tag{9}\]  
\[\text{RMSE}=\sqrt{\frac{1}{n}{\sum_{i=1}^{n}}(C_{i}-C_{ii})^{2}} \tag{10}\]  
where _Ci_, _Cii_, _Cm_, and \(n\) were the discriminated Kiwi, predicted Kiwi, the mean value of the Kiwi samples, and the total number of samples, respectively.