# Olive Oils Classification via Laser-Induced Breakdown Spectroscopy
## 3 Results and Discussion
### Classification Results Using the PCA Pre-Processed LIBS Spectroscopic Data  
At first, the unsupervised PCA technique was employed to obtain some reduction of the dimensionality of the LIBS data, and also to search for the occurrence of any pattern, in order to proceed, in the next stage, to further classification by means of algorithmic training. The 2D and 3D score plots for the first two and three PCs are presented in Figure 3a,b respectively. As can be seen from these plots, the H-samples are clearly separated from the C-, L- and R-ones, the latter forming a separate second cluster, suffering however, from some relatively important overlapping. Nevertheless, the explained variance from the first 3 PCs were determined to be 92.7% for PC1, 4.4% for PC2 and 1.3% for PC3 with a cumulative explained ratio of the order of 98.4%. The cumulative explained variance as a function of the number of PCs considered is shown in Figure 4a. As can be seen from this plot, the use of only few principal components (PCs) seems to be quite successful as the cumulative obtained variance very quickly attains a plateau, suggesting that the use of more PCs is not as necessary, as might be expected initially. The loadings plot for the first three PCs (i.e., PC1, PC2, PC3) are presented in Figure 4. Loadings are very important because their values relate the significance of every spectral feature from the original data with the related PC. For instance, by inspecting the plot for PC1 in Figure 4b, which has an explained variance of 92.7%, it becomes obvious that the whole spectra along with the strong background is very important in order to extract most of the variance which is explained by the first principal component, PC1. Furthermore, it seems that the CN band is more dominant than the other spectral features, while the hydrogen's H\({}_{\alpha}\) and H\({}_{\beta}\) spectral lines and the oxygen line have the most significant contributions for PC1. For the second principal component, PC2 (see e.g., Figure 4c), which has an explained variance of 4.4%, the previously mentioned emissions continue to contribute, with the contribution of the background being practically negligible, and thus almost vanished. The same pattern was found for the third principal component, PC3 (see e.g., Figure 4d), with an explained variance of only 1.3%. However, in this case, the C\({}_{2}\) bands seem to be the important features for this principal component. Figure 3: PCA (**a**) 2D and (**b**) 3D score plots and PCA-LDA (**c**) 2D and (**d**) 3D scatter plots corresponding to the olive oil samples from Chania (C), Herakleion (H), Lasithi (L) and Rethymnon (R) regions. Next, for the classification of the olive oils, the original dataset was pretreated through PCA and the obtained PCs were used as inputs for the k-NN, SVC and LDA algorithms. For the training of the algorithms 30 PCs were used, as Figure 4a suggests, since the 30 PCs explain more than 99% of the original variance. The accuracies of the predictive models were then found to be: (\(56.9\pm 2.5\))%, (\(88.9\pm 1.2\))% and (\(94.0\pm 1.1\))% for k-NN, SVC and LDA respectively. More specifically, the classification model resulting from the k-NN algorithmic training, indicates that this algorithm is the least suitable for the classification of the present samples. In contrast, the quite high accuracies obtained, along with the extremely low standard deviations of the SVC and LDA algorithms, indicate that they are both very successful predictive models. It is interesting to mention, that the accuracies of k-NN and SVC obtained after preprocessing of the raw data, are almost the same as the accuracies achieved directly using the raw data. This observation is very important, since it suggests that dimensionality reduction does not affect the accuracy of the predictive models while in the case of the LDA, the achieved accuracy was improved by more than 20%. The scatter plots of the 2D and 3D LDA algorithm are presented in Figure 3c,d, respectively.