## 4 Materials and Methods
### The Suggested BO-XGBoost Algorithm for Smart Prediction of Compressive Strength  
In this ongoing research, the aim was to merge XGBoost and BO into a unified BO-XGBoost model. This hybrid model is designed to predict the compressive strength of environmentally friendly concrete. XGBoost is the core predictive component within this model, formulating a function that estimates the compressive strength based on several parameters. As justified in Section 5, these include the superplasticizer content (in kg), water/binder ratio (W/B), GGBFS material percentage from total binder used in the mixture (GGBFS%), the recycled aggregate percentage from total aggregate in the mixture (RA%), and the curing time (Age). However, it is important to note that the performance of the XGBoost algorithm is contingent upon the choice of these parameters. This is where BO is used to identify the optimal set of these parameters. Once identified, these optimal parameters are integrated into the XGBoost model, which is then used for training. This optimized model subsequently delivers more precise and reliable predictions.  
Figure 1 provides a comprehensive visualization of the workflow for the BO-XGBoost model. This process is broken down into three crucial phases: preprocessing of data, optimizing parameters, and making the final prediction. During the first stage, preprocessing, a unique dataset has been compiled for a new type of concrete that incorporates both RCA and GGBFS materials, in addition to other standard concrete components. This dataset was created via a thorough literature review conducted over the period from 2010 to 2023. Also in this stage, the complete dataset is divided into two distinct subsets: a training set and a testing set. The training set is employed for model training and parameter optimization, while the testing set is reserved exclusively for evaluating the performance of the already trained models. During the parameter optimization phase in the BO-XGBoost model, BO must find the optimal XGBoost parameters. This requires a way to assess the efficacy of parameter sets, achieved by  
formulating an objective or cost function using RMSE and k-fold cross-validation. The training data is divided into '\(k\)' equally sized subsets or 'folds'. For each parameter set, the corresponding XGBoost model undergoes a training-testing cycle '\(k\)' times, each time with different subsets. The model trains on data from '\(k-1\)' folds and validates against the remaining fold. The Cost Function (CF), calculated as the average RMSE from all validation rounds (see Equation (14)) gives a quantifiable performance measure of each parameter set, enabling BO to locate the most optimal parameters  
\[\text{CF}=\frac{1}{k}\sum_{i=1}^{k}\ \mathbf{RMSE}_{i} \tag{14}\]  
\(\mathbf{RMSE}_{i}\) represents the validation RMSE linked with the ith fold, where the training set is comprised of the remaining folds:  
\[\mathbf{RMSE}_{i}=\sqrt{\frac{\sum_{j\in S_{i}}\left(Y_{\mathbf{A},j}-Y_{ \mathbf{P},j}\right)^{2}}{\left|S_{i}\right|}} \tag{15}\]  
In this context, \(S_{i}\) signifies the index set connected to the ith fold. The symbol \(\left|.1\right|\) is used to indicate the cardinality, or the number of elements, of a given set. \(Y_{\mathbf{A},j}\) refers to the actual outcome for the jth data set, while \(Y_{\mathbf{P},j}\) represents the corresponding estimated or predicted result.  
The BO stops its search once the cost function ceases to show improvement (decrease) after a specific number of iterations or when the predetermined maximum number of iterations is met. Once the optimal parameter set is identified, the corresponding XGBoost model is then utilized in the final stage of prediction. Subsequently, the forecasted values of compressive strength can be gathered and recorded.