# An Advanced Soil Classification Method Employing the Random Forest Technique in Machine Learning
## 5 Results and Discussion
### Performance of the Proposed RF  
In the validation cases, this study uses seven factors: Cc, Cu, PI, organic or inorganic soil classification, LL, percentage passing No. 4 sieve, and percentage passing No. 200 sieve. These factors are selected based on their reasonable ranges and their relevance to accurately identifying soil properties. The training data constitute 70% (364,921 data), while the testing data account for 30% (156,395 data).  
Subsequently, this study employs the RF model for soil classification. The parameters used in this RF model include the following: the number of variables to sample is set to all, surrogate splits are enabled, and pruning is disabled. The splitting criterion used is mean squared error (MSE), and the type of model is regression. The quadratic error tolerance is set to \(10^{-6}\), with a minimum parent size of 10 and a minimum leaf size of 1. The learning rate, maximum number of splits, and number of ensemble learning cycles are all determined using Bayesian optimization [33; 34; 35]. These parameters collectively define the configuration of the RF model used in this study.  
Figure 5 provides a visual representation of the correlation coefficient computed specifically for the training dataset. Upon examination, it becomes evident that both the training and testing datasets produce remarkably accurate results, exhibiting a notably high correlation coefficient of 0.99. This implies a robust alignment between the predicted values and the actual observations. As the data points closely conform to the optimal line, it signifies enhanced precision in classifying the soil properties. Furthermore, the validation cases corroborate these findings, revealing a compelling relationship between the soil property predictions derived from the seven factors outlined in this study and the real soil properties. This strong correlation underscores the efficacy and reliability of the analytical framework employed for soil characterization.  
Due to the inherent stochastic elements in the ML models and the influence of training data, the model's performance can exhibit variability across different training sets, resulting in slight disparities in results with each computation. To address this, in the present study, the ML model underwent 50 iterations, and the average values of relevant performance indices were computed to provide a more robust assessment. The analysis findings, outlined in Table 3, illustrate that the VAF, R\({}^{2}\), PI, NS, WI, AIC, RMSE, MAE, and WMAPE are 100, 1, 2, 1, 1, \(-\)2.23 \(\times\) 10\({}^{7}\), 7.96 \(\times\) 10\({}^{-4}\), 6.48 \(\times\) 10\({}^{-6}\), and 1.16 \(\times\) 10\({}^{-5}\), respectively. These analysis outcomes underscore the robustness of the proposed RF model in effectively discerning the characteristics of soil, providing valuable insights into soil classification and prediction.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Performance Indices** & **Ideal Value** & **Training** & **Testing** \\ \hline VAF & 100 & 100 & 100 \\ \hline R\({}^{2}\) & 1 & 1 & 1 \\ \hline PI & 2 & 2 & 2 \\ \hline \hline \end{tabular}
\end{table}
Table 3: The performance of the proposed RF across 50 runs.