## 4 Results and Discussion
### Recognition of Different Spectral Data
20 training samples into a particular class of data (a total of five classes of data in all). According to the characteristics of the sparse algorithm, the regression coefficient reflects in the corresponding training sample sets which has a relatively large value. In other words, the size and distribution of the value reflects its degree of similarity with the modeling samples, and, on the other hand, it is also relatively sparse to the regression coefficients of other classes of samples. Even though other classes of samples might also be close to the target sample, at the time of judgment, according to Equation (11), the target with the minimum residual is selected as the prediction output. Therefore, there must be such a target class to judge which classes the prediction samples belong to according to the residual between the estimated prediction samples in some linear space and the actual prediction samples, as shown in Figure 5a. In this figure, the \(x\) axis denotes the estimated classes of the prediction samples, the \(y\) axis stands for the residuals of the prediction samples, and graphs A, B, C, D, and E represent the prediction samples that actually belong to the first through fifth classes respectively. As indicated by Figure 5a, when the actual samples of each bar graph are consistent with the prediction samples, the residual of the training samples for that class is smaller than those of other classes, i.e., the corresponding classes of different prediction samples can all be recognized by their residual values, and the estimated residuals of the prediction samples in the linear space of the target are also significantly different from those of the other four classes. LRSC was compared with the common SIMCA, SVM, ANN, RF, and PLSDA algorithms for recognizing the data of _Tegillarca granosa_ polluted by different heavy metals, with the results shown in Table 1. All the parameters involved here were the optimal parameters of the cross-validation of the corresponding training samples, and the recognition result was the average and the corresponding variance of the testing set after a random division of the samples that was executed 50 times. Compared with other algorithms, LRSC, SIMCA, and PLSDA showed good classification performance regarding infrared spectral data. Their average recognition rate exceeded 80%, with LRSC reaching 98% and PLSDA 97%. As there are different ways to divide the samples, the recognition rate showed some fluctuation. The recognition rates of LRSC and PLSDA were comparatively stable \begin{table}
\begin{tabular}{c c c} \hline \hline
**Method** & **IR** & **LIBS** \\ \hline LRSC & **0.98 \(\pm\) 0.02** & 0.81 \(\pm\) 0.05 \\ SIMCA & 0.88 \(\pm\) 0.06 & 0.08 \(\pm\) 0.06 \\ SVM & 0.80 \(\pm\) 0.05 & 0.25 \(\pm\) 0.00 \\ ANN & 0.68 \(\pm\) 0.08 & 0.25 \(\pm\) 0.00 \\ RF & 0.65 \(\pm\) 0.09 & 0.52 \(\pm\) 0.07 \\ PLSDA & **0.97 \(\pm\) 0.01** & 0.46 \(\pm\) 0.09 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Recognition rates of different methods using infrared spectral data and LIBS data. Figure 3: Spectral data of _Tegillarca granosa_ polluted by different heavy metals. (**a**) Infrared spectral data. (**b**) Laser-induced breakdown spectral LIBS data. with a very small variance. ANOVA (analysis of variance) was used to test the differences between the recognition effects of different classification algorithms. The classification performance of LRSC was found to be significantly different from that of SIMCA, SVM, ANN, and RF. The \(p\) values of SIMCA, SVM, ANN, and RF were 0.01, \(7.10\times 10^{-5}\), \(3.87\times 10^{-5}\), and \(4.35\times 10^{-5}\), respectively (the smaller the \(p\) value, the more significant the difference). However, the \(p\) value of both LRSC and PLSDA was 0.35, indicating no significant difference between their recognition rates.