# Application of Machine Learning Models in Optimizing Wastewater Treatment Processes: A Review
## 4 Classification of ML Models Applied in the Optimization of Wastewater Treatment Processes
### ML Models Applied in the Optimization of Wastewater Treatment Processes
#### 4.1.2 Decision Trees (DTs) and Ensemble Models (EMs)  
ML's powerful tools are DTs and EMs, such as Random Forest (RF) and Gradient Boosting (GB) techniques, such as XGBoost (Extreme Gradient Boosting) and LightGBM (Light Gradient Boosting Machine), each one with its strengths and applications.  
DTs are a supervised ML technique that uses a tree-like decision model, successfully applied in water quality prediction and environmental monitoring because of their simplicity and interpretability, although they are prone to overfitting (when used with complex datasets) [29; 52]. A solution to this problem is represented by the usage of EMs such as RFs and GB. Because DTs can handle numerical and categorical data, they are useful tools for modelling the behavior of wastewater treatment processes [52].  
RFs are an EM method based on DTs that surpasses the overfitting problem by combining multiple decision trees during the training process, thus reducing the variance and improving model robustness and accuracy [69; 71; 72]. Because of the fact that they are effective in handling nonlinear relationships and interactions between features without data distribution assumptions, RFs are successfully applied in areas such as wastewater treatment and environmental monitoring [71; 73].  
The GB technique and its most used implementations (XGBoost, which outperforms other models because of its efficiency and scalability, and LightGBM, which was optimized for very large datasets and high-dimensional data) are sequentially developing models that correct the error of the previously supplied models [69; 72; 74]. XGBoost and LightGBM are suitable ML methods for complex prediction tasks (such as sludge production in WWTP)that provide superior predictive performance, unlike traditional ML methods [74]. Although it requires complex and detailed tuning, considering that it can be computationally expensive and time-consuming, XGBoost is known for its higher accuracy and ability in handling missing data and large datasets (it uses a parallel tree boosting method) for its regularization and scalability facilities [49; 75]. LightGBM (which uses a histogram-based decision tree algorithm in order to discretize feature values), on the other hand, has an improved computation (it quickly process very large datasets), focusing only on discrete boundaries; it achieves real-time prediction, updating the existing models with new samples; and it ensures faster training and prediction times, being an efficient tool that needs low storage requirements [67]. In addition, because it uses the Gradient-based One-Side Sampling (GOSS) algorithm, LightGBM prioritizes data samples with larger gradients, in order to ensure classification accuracy while reducing data volume [67].  
According to [PERSON] et al. and [PERSON] et al. [71; 74], XGBoost and LightGBM are very efficient at fitting nonlinear data, being preferred (because of their superior predictive capabilities) over traditional ML techniques, the choice of one of these two algorithms depending on the need for speed versus the need for precision, the task requirements, and the available computational resources.  
While DTs supply a simple and interpretable modelling approach, EM methods such as RFs and GB are improving the model's predictive performance by surpassing DTs' limitations, being a valuable tool in modelling complex and high-dimensional datasets.