# 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.1 Support Vector Machines (SVMs)  
SVMs are a representative ML technique (because, in high-dimensional feature spaces, they can identify the optimal hyperplanes necessary for class separation) that is usually applied for regression and classification tasks [66]. According [PERSON] et al. and [PERSON] et al. [52; 67], for classification tasks, SVMs use a kernel function that facilitates the class separation (by projecting data into higher-dimensional spaces), finding a hyperplane that maximizes the margin between various classes, thus being a very useful tool for scenarios in which the data are not linearly separable. For regression (usually for linear regression) tasks, SVMs use a similar idea; they map the input data into a higher-dimensional space, in order to achieve continuous output prediction [29; 56; 68]. Although it presents sensitivity to the kernel choice and high computational demands, the usage of SVMs is recommended because of the advantages it offers, such as flexibility, adaptability, high accuracy and robust performance, robust theoretical foundation, efficient handling of high-dimensional data, identification of an optimal hyperplane that maximizes the margin between classes (ensuring good results, even when the data are not linearly separable), ability in working with nonlinear and non-separable data, robustness to outliers, robust solutions, the manipulation of datasets that presents a high number of features, successful application in multi-class classification tasks (due its combination with other algorithms and to the usage of kernel techniques), and so on [52; 66; 67; 69]. Also, SVMs present a set of limitations, such as the fact that they are a computationally intensive method and less efficient than other methods (when using very large datasets,  
Figure 8: Taxonomic organization of supervised and unsupervised learning methods for wastewater treatment applications. the training time increases), they have problems with imbalanced datasets (all the samples are classified into the majority class), the selection of the right kernel and model hyper parameters are a challenging and time-consuming process (usually it requires the expert's knowledge and cross-validation), etc. [47; 67]. Datasets are said to be imbalanced when there are different numbers of classes or groups that are not evenly represented. There are normal conditions which account for 95% of the data, corresponding to operational conditions, whereas equipment failures, alarm conditions, or pollutant exceedances only account for 5%. This lack of balance is typically a problem in wastewater treatment applications: normal or operational data are much more prevalent than emergency/fail data. Some concentration ranges for pollutants are much more common than extreme concentrations. More data exists for specific treatment processes (normal biological treatment) than it does for special cases (chemical precipitation events). This imbalance is problematic for machine learning, as most models are naturally biased to prefer the majority class, which can beundesirable for extremely rare events that are, however, crucial to detect (for example, equipment breaking or violating compliance). Specialized methods are necessary, such as oversampling the minority class, undersampling the majority class, cost-sensitive learning algorithms, or ensemble methods designed for imbalanced data. SVMs were successfully applied in various domains, such as the analysis of water quality (demonstrating high accuracy in water samples classification and prediction of water quality indices), membrane flux modeling in water treatment processes (demonstrating high predictive accuracy, with values for the coefficient of determination R\({}^{2}\) higher that 0.99), the classification of water quality (97% accuracy, surpassing methods such as K-Nearest Neighbors--KNNs and RF), and in complex classification tasks such as text and object recognition [40; 49; 52; 66; 70].