# Water Quality Evaluation and Analysis by Integrating Statistical and Machine Learning Approaches
## 4 Results and Discussion
### Learning Curve Analysis Results  
The learning curve in Figure 10 represents model performance trends. The regression model exhibits consistently low training error, approaching zero, indicating high precision. However, the persistent gap between training and validation errors suggests overfitting,  
\begin{table}
\begin{tabular}{c c c c} \hline
**Parameters** & **Feature** & **Feature** & **Average Features** \\  & **Importance in** & **Importance in** & **Importance Across** \\  & **Regression Model** & **Classification** & **Models** \\  & & **Model** & \\ \hline DO & 1.000 & 1.000 & 1.000 \\ AN & 0.306 & 0.824 & 0.565 \\ COD & 0.025 & 0.496 & 0.261 \\ BOD & 0.037 & 0.279 & 0.158 \\ pH & 0.015 & 0.024 & 0.019 \\ TSS & 0.005 & 0.009 & 0.007 \\ \hline \end{tabular}
\end{table}
Table 1: Feature importance for water parameters.  
implying that the model generalizes poorly to unseen data. Reducing model complexity through pruning, depth restriction, or minimum sample splits may mitigate this issue.  
Similarly, the classification model (Figure 11) exhibits low training error, with validation error steadily decreasing as training size increases. This trend suggests improved generalization with more data, reinforcing the benefit of dataset expansion. Hyperparameter tuning can further optimize bias-variance trade-offs.  
To mitigate overfitting identified in earlier learning curve analysis, 10-fold cross-validation was applied to the Decision Tree Regression model, with additional constraints introduced through limiting tree depth and minimum sample splits. The performance metrics across folds were evaluated and bootstrapped to derive 95% confidence intervals. As shown in Table 2, the cross-validated Mean Absolute Error (MAE) was 11.52, with a 95% confidence interval ranging from 9.77 to 13.27. The Mean Squared Error (MSE) was 201.30 (95% CI: 142.37-260.27), reflecting moderate variance in predictive performance across different data partitions. However, the R\({}^{2}\) score averaged \(-\)1.48 (95% CI: \(-\)2.99 to \(-\)0.56), indicating that the model explained less variance than the mean-based baseline in most  
Figure 11: Learning curve for classification model.  
Figure 10: Learning curve for regression model.  
folds. This negative R\({}^{2}\) suggests underfitting caused by over-regularization or by inherent data noise within the dummy dataset, which lacks strong predictive relationships. Despite these limitations, the application of pruning and validation illustrates a structured and reproducible approach to addressing model generalization and highlights the importance of balancing model complexity with predictive power. These insights also reinforce the need for tuning hyperparameters and possibly selecting alternative model architectures in future work.  
Similar overfitting patterns in tree-based regression models have been noted in earlier studies. Refs. [48; 49] observed that Decision Tree Regression often performs well on training data but suffers in generalization due to limited model complexity and small datasets. Our observed negative R\({}^{2}\) aligns with these findings and highlights the need for model regularization or more advanced ensemble methods such as Gradient Boosting, which demonstrated higher accuracy in related studies by [46].