## 4 Clustering, Classification, and Quantification of Coal Based on Machine Learning
### Regression Models
#### 4.3.1 Partial Least Squares Regression  
Partial least squares regression (PLSR) is a component variable regression method based on principal component analysis and correlation analysis. The independent variables and dependent variables are projected to a new zone to obtain the principal components, which contain the information of the original data as much as possible. Meanwhile, the PLSR also retains the biggest correlation between independent variables and dependent variables. PLSR is suitable for several situations, for example, multiple independent variables correspond to multiple dependent variables, the independent and dependent variables have strong collinearity, and a small-size database has many independent variables.  
The number of partial least squares factors (k) is the key parameter of the PLSR model. The spectral information represented by each partial least squares factor decreases sequentially. If the k value is too big, the PLSR may be overfitting and if the k value is too small, the selected factors may not sufficiently represent the spectral information.  
The PLSR model was established for the prediction of ash, volatiles, and fixed carbon, and the cross-validation was conducted by the training and test sets. Then, the maximum R\({}^{2}\) value and the minimum RMSECV value were used to determine the best parameters of the model. If these two conditions could not be met at the same time, the condition with the maximum R\({}^{2}\) value will be used to build the model, because the RMSECV at this parameter is close to the smallest RMSECV value. Thus, the accuracy and stability of the model are similar to each other.  
Figure 8: Prediction results of naive Bayes.  
When the factor k of partial least squares was 12, the R\({}^{2}\) value was the largest and the RMSECV value is the smallest, with the values of 0.942 and 1.349%, respectively, as shown in Figure 9a. Then, the spectra of the prediction set were input into the model to obtain the predicted value of ash content. The R\({}^{2}\) value and RMSEP for the prediction set were 0.970 and 1.012%, respectively. According to the definition and Equation (6), the RMSEP could be considered as the predicted error.  
As for the volatile content, the cross-validation and prediction results are shown in Figure 10. When k was equal to 17, the R\({}^{2}\) value was the largest, and the RMSECV value was the smallest, with values of 0.882 and 0.803%, respectively. As for the prediction set, the R\({}^{2}\) value and RMSEP were 0.934 and 0.878%, respectively. It was indicated that although the fitting degree of the training set was not so high, the model did not overfit and had good applicability.  
For the fixed carbon, the cross-validation and prediction results are shown in Figure 11. When k was equal to 7, the R\({}^{2}\) value was the biggest, and the RMSECV value was 1.443%; however, the minimum RMSECV value (1.396%) appeared when k was equal to 10. Thus, the differences between these two models were little, k equal to 7 was used for modeling. The R\({}^{2}\) value and RMSEP value of the prediction set were 0.956 and 1.409%, respectively.  
Figure 10: Cross-validation results of partial least squares regression volatile quantification (**a**) and prediction set regression results (**b**).  
Figure 9: Cross-validation results of ash quantification with partial least squares regression (**a**) and prediction set regression results (**b**).  
The physical relation of ash, volatile, and fixed carbon meets the sum of 100% on a dry basis, and the cross-validation results and prediction results of the ash and volatile content were good. Thus, the prediction performance of fixed carbon may not greatly deviate. The results showed that both the cross-validation and prediction had good performance on the ash, volatile, and fixed carbon content, which indicated that the selected peaks in Section 3.3 had a good correspondence with the proximate analysis results.