# Dissolved Oxygen Modeling by a Bayesian-Optimized Explainable Artificial Intelligence Approach
## 4 Model Application and Results
### Model Optimization  
ML models are established to predict DO concentrations in the Mississippi River. The collected data are first normalized to ensure that all input features contribute equally to the model's learning process. Otherwise, features with larger numerical ranges may disproportionately influence the predictions, leading to biased outcomes and poor performance. For this purpose, the following \(Z\)-score normalization method is applied:  
\[z=\frac{x-\mu_{c}}{\sigma_{c}} \tag{15}\]  
where \(z\) = standardized value, \(x\) = original data point, \(\mu_{c}\) = mean of calibration data, and \(\sigma_{c}\) = standard deviation of calibration data. BO is employed to optimize the architecture of the models. The critical hyperparameters for optimization are presented in Table 2. In SVR, the box constraint controls the trade-off between achieving a low training error and a low testing error, which corresponds to the model's generalization capability. The Epsilon parameter defines the width of the epsilon-insensitive zone, within which errors are not penalized in the training loss function. The kernel scale parameter influences the width of the kernel function. A small value narrows the kernel, making the model focus more on the individual data points, potentially leading to overfitting. In RT, the minimum leaf size specifies the minimum number of observations that must be present in a terminal node. This parameter helps alleviate overfitting by ensuring leaf nodes contain enough data points to make reliable predictions. The maximum number of split parameters defines the maximum number of binary splits in the tree, effectively limiting the depth and complexity of the tree and thereby preventing the model from becoming overly complex and overfitting. In boosting, the number of learning cycles represents the number of weak learners sequentially added to the ensemble. A small \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Phase** & **Parameter** & **Minimum** & **Maximum** & **Mean** & **Standard Deviation** & **Skewness** \\ \hline \multirow{8}{*}{Training} & \(T\) (\({}^{\circ}\)C) & 2.30 & 31.40 & 18.49 & 8.44 & \(-\)0.03 \\  & \(Q\) (m\({}^{3}\)/s) & 5918.21 & 38,794.02 & 19,734.95 & 8856.50 & 0.48 \\  & \(G\) (m) & 2.06 & 13.58 & 8.00 & 3.22 & 0.06 \\  & pH (-) & 6.90 & 8.30 & 7.73 & 0.19 & \(-\)0.64 \\  & \(T\)u (FTU) & 8.60 & 244.00 & 54.31 & 27.82 & 1.75 \\  & \(Sc\) (\(\mu\)S/cm) & 241.00 & 593.00 & 384.13 & 70.25 & 0.38 \\  & DO (mg/L) & 5.10 & 13.30 & 8.34 & 2.02 & 0.36 \\ \hline \multirow{8}{*}{Testing} & \(T\) (\({}^{\circ}\)C) & 5.60 & 31.50 & 19.65 & 8.14 & \(-\)0.07 \\  & \(Q\) (m\({}^{3}\)/s) & 3709.50 & 27,778.78 & 12,131.70 & 6867.20 & 0.74 \\ \cline{1-1}  & \(G\) (m) & 1.11 & 10.88 & 4.92 & 3.03 & 0.59 \\ \cline{1-1}  & \(P\)H (-) & 7.60 & 8.10 & 7.87 & 0.12 & \(-\)0.09 \\ \cline{1-1}  & \(T\)u (FTU) & 10.50 & 161.00 & 43.60 & 30.48 & 1.23 \\ \cline{1-1}  & \(Sc\) (\(\mu\)S/cm) & 272.00 & 531.00 & 392.41 & 70.92 & 0.01 \\ \cline{1-1}  & DO (mg/L) & 5.60 & 12.30 & 8.25 & 1.83 & 0.42 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Statistics of the datasets used in this study. value might underfit the data, while a large one risks overfitting. The definitions of leaf and split sizes are the same as those of RT, as RT is the base learner. BO searches for the optimal set of hyperparameters for the models by minimizing the error metric RMSE. The objective function is evaluated 30 times for each model. This number is determined through a trial-and-error approach by monitoring the reduction in function values. The hyperparameter optimization process is shown in Figure 4. The errors rapidly decrease to a low level, demonstrating the model's swift convergence and optimization capability. The Bayesian-optimized model parameter values are exhibited in Table 2. These optimal setups are then applied to estimate DO concentrations. DO modeling can be achieved by using external influencing parameters as inputs or using lagged DO values.