## 4 Discussion
### Feature Variables Selection, Model Construction, and Variable Contribution to the Model  
Partial least squares regression (PLSR), random forest (RF), and backpropagation neural network (BPNN) were chosen as models for this study because these three represent different types. PLRSR is a linear model, RF is a machine learning model, and BPNN is a deep learning model. The latter two models have considerable noise resistance. Unlike previous studies, 29 spectral indicators were constructed and 6 mathematical transformation methods (reciprocal \((\mathbf{1}/\mathbf{R})\), logarithm \(\mathbf{In}\mathbf{R}\), exponential \(\boldsymbol{e}^{R}\), square root \(\mathbf{R}^{0.5}\), first derivative \(\mathbf{R}^{{}^{\prime}}\), and second derivative \(R^{{}^{\prime\prime}}\)) were applied. For PLRSR, variables selected through feature selection were used to build the soil salinity model, while for RF and BPNN, a total of 75 variables, including original bands, mathematically transformed variables, and spectral indicators were used. The results indicated that among the three models, RF performed the best, showing superior results in the training, validation, and test sets across five evaluation metrics, with the performance of the test set achieving an R\({}^{2}\) of 0.55,RMSE of 3.4, MAE of 2.79, SD of 2.99, and MSE of 11.62. This shows that the RF algorithm effectively constructs the soil salinity inversion model. Random forest is a nonlinear model capable of capturing nonlinear relationships. The final prediction is the average of the results from all decision trees, effectively reducing the impact of noise. Therefore, this study selected a total of 75 variables. However, it must be acknowledged that a large number of features increase the complexity of the model, prolong the training time, and consume more memory and CPU resources, which is particularly evident in the final visualization and unfriendly to low-performance computers. Hence, we explored methods to further reduce the number of features and decrease model complexity. We obtained feature importance from the best-performing trained random forest model. In the random forest regression model, feature importance is calculated based on each feature's contribution when constructing decision trees. This is determined by measuring the average reduction in mean square error contributed by each feature across all trees. After training the random forest model, the feature_importances attribute was used to extract the importance scores for each feature. According to the importance scores from the random forest, the top 20 most important variables for model construction were identified, as shown in Figure 14.  
Then, we built a new random forest model using the 15 features highlighted in red in Figure 14. These features were selected using Pearson correlation to eliminate those with collinearity above 97% (see Figure 15). The results show that the random forest model built using 15 features achieved an R\({}^{2}\) of 0.52 and an RMSE of 3.5 (see Figure 16) on the test set, compared to the model built with 75 features, which achieved an R\({}^{2}\) of 0.55 and an RMSE of 3.4, indicating a slight decrease in performance. Therefore, it can be concluded that while random forest effectively captures nonlinear relationships and achieves relatively higher accuracy when using all 75 features, the model is more complex, requires longer training time, and consumes more CPU and memory resources. In comparison, the model built with the selected 15 features has slightly lower accuracy but is simpler, trains faster, and is more suitable for computers with lower performance. Figure 14: Top 20 important variables in RF. The red words indicate variables retained after a correlation analysis in Figure 15, which filtered out variables with high correlation, then used to construct a new RF model.