## 2 Materials and Methods
### Machine Learning Methods
#### 2.3.2 Support Vector Machine (SVM)  
An SVM has excellent generalization ability between model complexity and learning ability when dealing with limited sample information [29]. In SVM applications, choosing the appropriate kernel function and suitable parameters is crucial for prediction accuracy. As for the linear separable binary classification, finding the optimal hyperplane that divides all samples with maximum margin is the principal function of an SVM. For linear problems, the optimal classification hyperplane in separating two classes of training vector sets \(D\) is  
\[D=\left\{{\left({x^{1},\ y^{1}}\right),\ldots,\left({x^{l},y^{l}}\right)} \right\},\ x\in R^{n},y\in(-1,1). \tag{5}\]The plane was assumed as  
\[<w,x>+b=0, \tag{6}\]  
When the optimal classification surface is generated, the vectors are classified without error, and when redundancy occurs, a typical hyperplane is assumed where \(w\) and \(b\) are constrained:  
\[min_{i}\big{|}<w,x^{i}>+b\big{|}=1. \tag{7}\]  
The classification hyperplane in the regular form must satisfy the following constraints:  
\[y^{i}\Big{[}<w,x^{i}>+b\Big{]}\geq 1,\ i=1,\ldots,l. \tag{8}\]  
The coordinate of the point \(x\) in the hyperplane at a distance \(d(w,b;x)\) is  
\[d(w,b;x)=\frac{\big{|}<w,x^{i}>+b\big{|}}{||w||}, \tag{9}\]  
The final hyperplane that can satisfy the separated samples is the hyperplane that minimizes the data:  
\[\Phi(w)=\frac{1}{2}||w||^{2}. \tag{10}\]  
For nonlinear classification, the idea of SVM is to map the samples to a high-dimensional space, where the nonlinear problem is transformed into a linear solution using a kernel function, at which point the weight \(w\) is expressed as  
\[w=\sum_{i=1}^{l}\alpha_{i}y_{i}\Phi(x_{i}). \tag{11}\]  
Introducing the relaxation variable \(\xi(\xi\geq 0)\) describing the function interval, the optimization equation under the kernel approach is expressed as  
\[\min\alpha+C\sum_{i=1}^{l}\xi. \tag{12}\]  
The model is described as  
\[\left\{ \begin{array}{c}y_{l}\left(\sum_{j=1}^{l}\alpha_{j}y_{j}K\big{(}x_{j },y_{i}\big{)}+b\right)\geq 1-\xi_{i},\ i=1,\ldots,l\\ \alpha\geq\alpha_{j},\ j=1,\ldots,l\\ \alpha\geq-\alpha_{j},\ j=1,\ldots,l\\ \alpha,b\in R,\xi_{i}\geq 0,i=1,\ldots,l\end{array} .\right. \tag{13}\]  
In the present study, the SVM model was adopted to control the inverter frequency to improve circulating pump operating efficiency under different water quality conditions. The SVM is a kind of machine learning algorithm with a high generalization ability to classify and predict small samples. As upshifting and downshifting of the circulating pump is a binary problem, water quality indicators as variables can provide good generalization ability for the model. Support vector classification (SVC) can be used as the core algorithm for developing drum filter-circulating pump linkage technology. However, there is no international standard for selecting optimal parameters, and the parameter selection principles are based on dataset performance and the construction of a more reliable solution through cross-validation methods [30,31]. Here, we used the Gaussian kernel function in resolving the nonlinear support vector classification task:  
\[K(x,z)=exp\left(-\frac{||x-z||^{2}}{2\sigma^{2}}\right), \tag{14}\]  
For the SVM model, the penalty parameter C and RBF kernel parameter g need to be decided to improve the classification accuracy. In the present study, several optimizing algorithms, including grid search (GS), least squares method (LS), genetic algorithm (GA), and cuckoo search (CS) algorithm, were applied to improve the classification performance of the SVM model. The parameters of GA were set as follows: max generation = 300, population size = 50, generation gap = 0.9, range of parameter c = (0, 100), range of parameter g = (0, 1000). For the CS algorithm, the parameters were set as follows: iteration = 300, number of nests = 20, probability = 0.25.