## 3 Methodology
### Predictive Modeling Using Tree-Based Ensemble Learning Algorithms  
To accurately estimate the total unit cost and carbon emissions associated with steel slag utilization in road base construction, supervised machine learning models were developed based on a set of tree-based ensemble regression algorithms. These models were selected due to their established ability to capture complex, nonlinear relationships in high-dimensional and heterogeneous datasets, which are common in infrastructure and sustainability-focused studies [30; 31; 32]. In particular, four widely recognized ensemble learning methods were employed in this study: Random Forest Regressor (RFR), Extremely Randomized Trees (ERT), Gradient Boosted Regressor (GBR), and Extreme Gradient Boosting Regressor (XGBR). Figure 1: Schematic flow diagram of the methodological framework. The selected models represent four categories of tree-based ensemble methods commonly used in infrastructure analytics [33]. RFR and ERTs are bagging-based algorithms, with RFR utilizing bootstrap aggregation of decision trees and ERTs introducing randomized node splitting to further reduce variance. In contrast, GBR and XGBR are boosting-based techniques, where weak learners are sequentially improved by minimizing residual errors. XGBR further enhances performance by incorporating regularization and second-order loss approximations [34; 35; 36]. These distinctions allow for comparison of variance-bias trade-offs and learning dynamics across bagging and boosting regimes within the same input space. To enhance transparency and mathematical rigor, the learning process underlying each ensemble model is briefly formalized below. In supervised regression settings, the objective is to approximate a mapping function f:R\({}^{\rm P}\)\(\rightarrow\)R, where the input vector x = [X\({}_{1}\)X\({}_{2}\),...,X\({}_{\rm P}\)] corresponds to engineered features and the output y\(\in\)R denotes the target variable (either cost or CO\({}_{2}\) emission in this study). Tree-based ensemble models approximate this mapping by aggregating the predictions of multiple base regressors. RFR consists of T individual regression trees \(\{\rm h_{t}(\cdot)\}_{t=1}^{\rm T}\), each trained on a bootstrapped sample of the training data with random feature selection at each split. The final prediction is given by Equation (6):  
\[\hat{y}_{\rm RF}=\frac{1}{\rm T}\sum_{t=1}^{\rm T}h_{t}(x) \tag{6}\]  
ERTs follow a similar ensemble structure but introduce additional randomness by selecting split thresholds randomly rather than optimizing them, which helps further reduce variance and computational cost. GBR is an additive ensemble model that incrementally updates the prediction function by fitting new trees to the negative gradient of the loss function. At each iteration m, the model is updated as described in Equation (7). \[\rm F_{m}(x)=F_{m-1}(x)+\eta\cdot h_{m}(x) \tag{7}\]  
where \(\eta\) is the learning rate and \(\rm h_{m}(x)\) is the regression tree trained to minimize the residuals. XGBoost improves on conventional boosting by using a second-order Taylor expansion of the loss function and applying regularization to penalize model complexity. Equation (8) provides the approximation of the objective at iteration \(t\). \[\rm L(t)\approx\sum_{i=1}^{n}\left[g_{i}f_{i}(x_{i})+\frac{1}{2}h_{i}f_{i}^{2 }(x_{i})\right]\Omega(f_{i}) \tag{8}\]  
where \(g_{i}\) and \(h_{i}\) are the first and second derivatives of the loss with respect to current predictions, and \(\Omega(f_{i})\) is a regularization function over the tree structure \(f_{i}\). This formulation enables improved convergence, better generalization, and reduced overfitting. In all models, training aims to minimize the empirical risk, which is defined by the Mean Squared Error (MSE) in Equation (9). \[\rm L(y,\hat{y})=\frac{1}{n}\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2} \tag{9}\]  
The empirical risk function \(\rm L(y,\hat{y})\), in the context of supervised learning, quantifies the average discrepancy between observed outputs and model predictions.