## 3 Methodology
### Predictive Modeling Using Tree-Based Ensemble Learning Algorithms
In this study, the MSE was selected as the loss function due to its sensitivity to large deviations and its smooth, differentiable form, which is suitable for optimization. The function computes the squared difference between the actual value \(y_{i}\) and the predicted value \(\hat{y}_{i}\) for each observation i\(\in\){1,2,..., n}, sums these squared errors across the dataset, and normalizesthe result by the number of instances n. Minimizing this quantity leads the model to learn parameters that produce predictions \(\hat{y}_{i}\) as close as possible to the true targets \(y_{i}\), in the least-squares sense. To ensure the predictive robustness of the GBR model used in this study, hyperparameter tuning was conducted using Bayesian optimization with Gaussian Process priors, implemented via the skopt package. The search space and prior distributions were defined as follows: learning rate \(\in\) [0.01, 0.3] (log-uniform), number of estimators \(\in\) [100, 1000] (uniform), max depth \(\in\) [3, 10] (uniform), subsample \(\in\) [0.5, 1.0] (uniform), and min samples split \(\in\) [2, 20] (uniform). The optimization was performed over 30 iterations using 5-fold cross-validation based on R\({}^{2}\) score. Early stopping was not applied during the tuning process; instead, the configuration yielding the highest cross-validated R\({}^{2}\) was selected. These models were selected not only for their theoretical strengths but also for their suitability in modeling the specific target variables defined in this study. Each model was trained independently to predict two continuous output variables: (i) the total transportation and processing cost per cubic meter of compacted slag material (USD/m\({}^{3}\)), and (ii) the equivalent carbon dioxide emissions per unit volume (kg CO\({}_{2}\)-e/m\({}^{3}\)), based on the five engineered input features described in Section 2. Model development followed a rigorous training-validation pipeline. The complete dataset consisting of 482 samples was first randomly partitioned using an 80:20 stratified split, where 80% of the data was used for training and the remaining 20% reserved for testing [37]. Input features were normalized on a [0, 1] scale for numerical stability, and categorical variables such as gradation level were transformed using one-hot encoding. To ensure robustness and reduce model variance, five-fold cross-validation was conducted on the training subset, with performance evaluated on both training and validation folds at each iteration [38]. To further improve prediction accuracy and avoid suboptimal hyperparameter configurations, each model underwent hyperparameter tuning using a Bayesian Optimization Algorithm (BOA) [39] which finds posterior possibility via prior knowledge as follows Equation (10):  
\[\text{p}(\text{wD})=\frac{\text{p}(\text{Dw})\text{p}(\text{w})}{\text{p}( \text{D})} \tag{10}\]  
where p(Dw) denote the prior and posterior distributions, respectively; p(Dw) represents the probability, and w is the unseen data. Utilizing the Bayes' rule, the result of the last iteration is searched for that value on the next iteration. The search space was defined based on prior empirical studies and included parameters such as the number of trees (ranging from 100 to 1000), learning rate (0.01-0.30), and maximum tree depth (3-30). Bayesian optimization was selected over grid or random search due to its superior sample efficiency and ability to incorporate prior performance distributions into its acquisition strategy, thereby reducing convergence time and computational cost. Model performance was quantitatively assessed using four standard evaluation metrics [34]. The Pearson correlation coefficient (R), computed as shown in Equation (11), was used to evaluate the linear association between predicted and actual values, providing insight into overall fit. Mean absolute error (MAE), defined in Equation (12), provides an average measure of prediction deviation without considering directionality, offering robustness to outliers.