## 2 Materials and Methods
### Machine-Learning Models
#### 2.5.2 Gradient Boosting Regressor (GBR)  
For regression and classification purposes, gradient boosting is a machine-learning technique that generates a prediction model as an ensemble of weak prediction models [50], typically decision trees. It builds the model step-by-step; it is one of the boosting procedures and is used to lower the model's bias error [35]. The gradient boosting regressor (GBR) model's experimental protocol is described as follows:  
Initialization:  
\(\bullet\)\(\hat{\mathbf{y}}_{0}\) = initial model prediction (e.g., average target value)  
\(\bullet\) M = ensemble of weak learners  
Boosting iterations:  
\(\bullet\) For m = 1 to M:  
Calculate residuals: \(\text{r}_{\text{i}}\) = \(\text{y}_{\text{i}}\) - \(\hat{\mathbf{y}}_{\text{i}-1}\)  
Train weak learner \(\text{h}_{\text{m}}(\text{x})\) on (X, r)  
Update ensemble: \(\hat{\mathbf{y}}_{\text{i}}\) = \(\hat{\mathbf{y}}_{\text{i}-1}\) + \(\alpha\) * \(\text{h}_{\text{m}}(\text{x}_{\text{i}})\)  
Prediction:  
\(\bullet\)\(\hat{\mathbf{y}}\) = \(\sum[\alpha_{\text{m}}\) * \(\text{h}_{\text{m}}(\text{x})]\)  
Evaluation:  
\(\bullet\) Metrics on X_test  
A primary dataset including 294 observations has been generated using the results of the hygroscopic properties experiments. The BNF's mass, relative humidity, ambient temperature, and time of exposure are the variables that constitute the main dataset, which is used to test and train the output parameter before being processed to encode categorical features and divided into training and testing (80/20). The details of some of the data are shown in Table 2. A summary of the structure and functioning of both models is shown in Table 3.  
\begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline
**Time** & **Mass** & **Relative** & **Temp.** & **Specific Mass** & **Time** & **Mass** & **Relative** & **Temp.** & **Specific Mass Mt** \\
**(min)** & **(mg)** & **H humidity** & **(\%C)** & **Mt (\%)** & **(min)** & **(mg)** & **H humidity** & **(\%C)** & **(\%)** \\ \hline  
\hline \end{tabular}
\end{table}
Table 2: Details of the experimental results used to create the primary data, with the different variables used as inputs during testing and training for the GBR and the DTR models to predict the specific mass.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**DTR** & **GBR** \\
**Structure**: Comprises a tree-like structure where nodes represent decisions based on feature values, and leaves represent the output (predicted values). & **Structure**: An ensemble of multiple weak learners (usually shallow decision trees) combined to form a strong predictive model. **Functioning:** & \\
**Functional**: & \(\bullet\) Sequentially builds trees, with each tree trained to correct errors made by the previous trees. & by the previous trees. \\
**1** Uses a loss function to measure errors and adjusts the model iteratively to minimize this loss. & \(\bullet\) Combines the predictions of all trees, usually through a weighted sum, to make the final prediction. \\ \hline
**188.15** & **15.12** & **24.27** & **2.75** \\ \hline \hline \end{tabular}
\end{table}
Table 3: Structure and functioning of DTR and GBR.