# Olive Oils Classification via Laser-Induced Breakdown Spectroscopy
## 3 Results and Discussion
### Classification Using the Raw LIBS Spectroscopic Data  
At first, the raw LIBS spectroscopic data were used as inputs for the k-NN, SVC and LDA algorithmic training. The obtained accuracies were determined to be:(\(57.2\pm 2.7\))%, (\(89.4\pm 0.9\))% and (\(71.5\pm 2.4\))% respectively. This finding suggests that the predictive model resulting from the k-NN algorithmic training seems to be the least successful for classification purposes in this case. In contrast, the quite high accuracy of the SVC algorithm, along with its very low standard deviation, suggests a very successful predictive model choice. For the training of the LDA algorithm, 35 canonical variables were used (which is the maximum number of canonical variables that can be used for training, as their maximum number can be as high  
\begin{table}
\begin{tabular}{c c c c c} \hline
**Sample** & **f1-Score** & **Support** & **Sample** & **f1-Score** & **Support** \\ \hline C\(I\) & 1 & 5 & _H10_ & 1 & 5 \\ C\(2\) & 1 & 5 & _H11_ & 1 & 5 \\ C\(3\) & 1 & 5 & _H12_ & 1 & 5 \\ \(C4\) & 0.9 & 5 & _L1_ & **0.7** & 5 \\ C\(5\) & 0.7 & 5 & _L2_  
as the number of samples, i.e., 36 reduced by 1). As can be seen from the corresponding 2D and 3D scatter plots of Figure 2a,b, the samples H1-H12 and the C1-C9 ones were clearly distinguishable and well separated from the other samples, while some limited overlapping was found to occur for the L1-L7 and R1-R8 samples. Although the LDA algorithm provided relatively good separation between samples based on the results of these figures, its accuracy was found to be only slightly higher than 70%, making the LDA predictive model not a preferred choice. The reason for this relatively low accuracy of the LDA model is because in each cluster there exist many different samples and there is a possible extra overlapping between them, that cannot be observed visually in the plots of Figure 2a,b, due to the coloring of the clusters. Because of this situation, and in order to better evaluate the above findings, the corresponding classification reports were constructed and are shown in Table 1. The classification report offers a more detailed picture of the classification procedure, including all the samples, alongside with their behavior during the algorithmic training. The f1-score shown in Table 1 is a weighted harmonic mean of the precision and recall parameters, so that the best score corresponds to 1.0, while the worst one corresponds to 0.0 [33]. The precision parameter denotes the ability of a classifier not to label an instance positive that is actually negative. For each class, it is defined as the ratio of true positives to the sum of true and false positives. The recall parameter expresses the ability of a classifier to find all positive instances. For each class it is defined as the ratio of true positives to the sum of true positives and false negatives. The individual values of the precision and recall parameters are not included in Table 1 for simplicity reasons, since the f1-score contains information related to both of them. The other parameter used for the evaluation of the results of Table 1, is the so-called support parameter. The support is the number of actual occurrences of a class in the specified dataset. For further evaluation of the classifier's overall f1-score, the simple arithmetic mean of the per-class f1-scores is also used, which is called macro average. The classification report tables with precision and recall values for k-NN, SVC and LDA on raw data are presented in Tables S2a, S3a and S4a, respectively, in the Supplementary Material section. As can been seen in Table 1, in the case of k-NN, 16 of 36 samples present f1-scores lower than 0.5, suggesting the reduced suitability of this model to classify the samples correctly. On the other hand, the macro average of 0.6 or 60% is very close to the accuracy of the algorithm which was found to be \((57.2\pm 2.7)\%\).