# Prediction of Unconfined Compressive Strength in Cement-Treated Soils: A Machine Learning Approach
## 2 Materials and Methods
### Machine Learning Methodology
#### 2.3.6 Uncertainty Quantification Framework  
Rather than developing traditional point prediction models, this study implements an advanced uncertainty quantification system that provides both central UCS estimates and calibrated confidence intervals. This methodological evolution recognizes that in geotechnical engineering applications, understanding prediction uncertainty is as critical as the prediction itself for informed decision-making and risk assessment [89, 90]. Standard bootstrap aggregating (bagging) was initially investigated to quantify uncertainty via prediction intervals [91]. However, the empirical coverage of bootstrap-based intervals was systematically below the expected confidence levels, likely due to the limited dataset size. Bootstrap methods rely on the assumption that repeated sampling from the observed data adequately represents the underlying population distribution, but this assumption becomes problematic when the available dataset is relatively small compared to the complexity of the underlying physical processes [92]. To address this limitation, a more robust approach was implemented that leverages the systematic error patterns captured during nested cross-validation (NCV). The uncertainty quantification framework employs a sophisticated two-stage architecture that separates the prediction task from uncertainty estimation, allowing independent optimization of both components. The first stage develops the highest-accuracy model for central UCS predictions using the optimal algorithm and hyperparameters identified through the nested cross-validation process. The second stage constructs a dedicated uncertainty model that learns to predict the magnitude of prediction errors based on both input features and primary model outputs. This architectural separation offers significant advantages over traditional ensemble approaches such as bagging, which attempt to estimate uncertainty through variance across multiple models [93]. By dedicating a specialized model to uncertainty estimation, the framework can focus specifically on identifying patterns in prediction confidence without compromising central prediction accuracy. The two-stage approach also enables the uncertainty model to learn from the primary model's behavior patterns, creating a more informed uncertainty estimation process. The uncertainty model training leverages the comprehensive prediction error dataset generated during nested cross-validation. Since each data point serves as a validation sample exactly once across the outer folds, the NCV process produces a complete set of out-of-sample predictions and their corresponding absolute errors for the entire dataset [94]. These cross-validation errors provide an unbiased representation of model uncertainty across different regions of the input space, forming ideal training data for the uncertainty prediction task. The uncertainty model learns to predict these error magnitudes using an augmented feature set that combines the original input variables (cement content, curing period, compaction rate) with the primary model's predictions. This feature augmentation enables the uncertainty model to capture heteroscedastic patterns--the observation that prediction uncertainty often varies with prediction magnitude--commonly encountered in geotechnical datasets where higher strength values may exhibit greater absolute variability. The uncertainty estimation employs a Random Forest regressor specifically configured for error prediction rather than primary value prediction. Random Forest was selected for uncertainty modeling due to its robust handling of small datasets, natural resistance to overfitting, and ability to capture complex non-linear relationships without extensive hyperparameter tuning. The uncertainty model configuration includes 200 estimators with a maximum depth of 8, parameters chosen to balance prediction accuracy with computational efficiency and stability.