## 4 Clustering, Classification, and Quantification of Coal Based on Machine Learning
### Regression Models
#### 4.3.2 LASSO Regression  
Least absolute convergence and selection operator (LASSO) regression minimize the sum of squared residuals and generate some regression coefficients equal to 0 when the sum of the absolute values of the regression coefficients is less than a constant. LASSO regression can be concluded that L1 regularization is implemented based on the least squares method, which can make the variables sparse to remove some variables that are not conducive to regression. Thus, the remaining variables will play a key role in the regression model. Compared with L1 regularization, L2 regularization (ridge regression) obtained smooth solutions instead of sparse solutions. In other words, the regression coefficients of some dimensions are close to 0 rather than equal to 0, which also simplifies the complexity of the regression model.  
The key parameter of LASSO regression is the alpha value, which is the degree that the regression coefficient tends to zero. When alpha is close to zero, the model is the ordinary least squares method solved by linear regression. The alpha values at 0.3, 0.5, and 1.0 were first calculated to find some regularity. The results showed that the fitting degree of the model decreased with the increase in alpha value. Thus, the range of alpha could be determined from 0.01 to 0.4, and each time increased by 0.02 to find the index with the maximum R\({}^{2}\) value and minimum RMSECV value.  
In general, the performance of PLSR was better than LASSO regression, and the selected parameter was close to 0, which was similar to the ordinary least squares method. Thus, the calculation could be conducted with the assistance of L2 regularization to improve the model accuracy.  
The cross-validation and prediction results of the ash LASSO regression were shown in Figure 12. When the alpha was 0.15, the accuracy and stability of the model on the training and test set were the best. For the prediction set, the R\({}^{2}\) value was 0.967 and the RMSEP was 1.063%, which was similar to the result of PLSR. Thus, both LASSO regression and PLSR had a good performance to remove collinearity and implement the regression of ash.  
Figure 11: Cross-validation results of partial least squares regression fixed carbon quantification (**a**) and prediction set regression results (**b**).  
The quantification results for volatiles by using LASSO regression are shown in Figure 13, and the optimal alpha value of the model was 0.01, which indicated that the L1 regularization of the LASSO regression did not play an important role in modeling. LASSO regression performs better in feature selection with high-dimensional data, which indicated more spectral peaks could be introduced for the model training, especially for LASSO regression. The cross-validation R\({}^{2}\) was 0.840, RMSECV was 0.923%, prediction R\({}^{2}\) was 0.904, and RMSEP was 1.060%, which was inferior to PLSR.  
As shown in Figure 14, when alpha was equal to 0.05, the cross-validation results of fixed carbon were the best, with cross-validation R\({}^{2}\) and RMSECV values of 0.942 and 1.310%. On this condition, LASSO regression was similar to the ordinary least squares regression, which also indicated that the PLSR was more applicable than LASSO regression to the current coal database.  
Figure 12: Cross-validation results (**a**) and prediction set regression results (**b**) for LASSO regression ash quantification.  
Figure 13: Cross-validation results (**a**) and prediction set regression results (**b**) for LASSO regression volatile quantification.