# Prediction of Unconfined Compressive Strength in Cement-Treated Soils: A Machine Learning Approach
## 3 Results and Discussion
### Uncertainty Quantification System Performance  
Following the comprehensive evaluation through nested cross-validation, a two-stage uncertainty quantification (UQ) framework was implemented and thoroughly evaluated. The integrated system demonstrated exceptional capability in providing both accurate central predictions and reliable uncertainty estimates, representing a significant advancement over traditional point prediction approaches in geotechnical engineering. The UQ system operates via the coordinated function of two specialized models: a primary model for central UCS prediction (Figure 8), and a dedicated uncertainty model trained to estimate prediction error magnitudes (Figure 9). This architectural separation allows each model to optimize its specialized task, working synergistically to deliver not only precise predictions, but also informative and trustworthy confidence intervals--critical for robust engineering decision-making. Despite achieving nearly identical cross-validation performance across the three candidate algorithms, Random Forest was selected as the foundation for the uncertainty quantification framework based on several critical considerations beyond pure predictive accuracy. The algorithm demonstrated the most consistent performance across validation folds with the lowest standard deviation in R\({}^{2}\) scores (0.012), indicating superior stability and reliability--essential characteristics for uncertainty quantification where consistent error patterns are crucial for calibration quality. Additionally, Random Forest's computational efficiency for real-time inference and its natural resistance to overfitting made it particularly suitable for deployment as a web-accessible tool. The algorithm's ensemble of independent Decision Trees aligns well with the dual requirements of the uncertainty framework: providing accurate central predictions while maintaining the consistent, interpretable error patterns necessary for reliable uncertainty estimation. The final Random Forest model was trained on the complete experimental dataset of 185 UCS measurements using the optimal hyperparameters identified through Bayesian optimization: 261 estimators with a maximum depth of 5, minimum samples per split of 6, and minimum samples per leaf of 2. The model achieved R\({}^{2}\) = 0.9478 when trained on the complete dataset, compared to the cross-validated estimate of R\({}^{2}\) = 0.9471 \(\pm\) 0.012. This minimal difference (\(\Delta\)R\({}^{2}\) = 0.0007) confirms that the nested cross-validation provided unbiased performance estimates. The uncertainty model employs a fundamentally different training approach to prevent data leakage and ensure reliable uncertainty estimation. During the 5-fold outer cross-validation, each of the 185 data points serves as a validation sample exactly once across different folds. For each validation instance, the Random Forest model--trained exclusively on the remaining 4 folds--generates a genuine out-of-sample prediction. The absolute error for each prediction is calculated as  
\[\text{error}_{i}=|\text{UCS}_{\text{measured},i}-\text{UCS}_{\text{predicted},i}| \tag{1}\]These 185 out-of-sample absolute errors form the training targets for the uncertainty model, which learns to predict them using an augmented feature set:  
\[[\text{cement content},\text{curing period},\text{compaction rate},\text{UCS prediction}]\longrightarrow\text{absolute error} \tag{2}\]  
Figure 8: Performance analysis of primary Random Forest model for central UCS prediction: (**a**) UCS predicted vs. measured values. (**b**) Distribution of prediction errors (actual minus predicted UCS values) showing model accuracy. The red dashed vertical line indicates zero error (perfect prediction), while the blue curve represents the fitted normal distribution overlaid on the histogram. The near-zero-centered distribution demonstrates minimal systematic bias in the model predictions. (**c**) Residual plot showing the relationship between predicted UCS values and prediction residuals.