## 2 Materials and Methods
### Modelling
#### 2.5.2 Regression Similarity Approach  
The other stage of the modelling is to examine the performance of predicting the FR values of pollutants at different time intervals with machine learning methods. Therefore, regression methods are used instead of classification methods in order to measure the effects of pollutants in the system as inputs on the FR value. As the FR values are real numbered variables that do not contain any class information (0 or 1), regression methods will enable the determination of both the current and future FR values of the system. If the problem is linear, linear regression methods should be used. Otherwise, non-linear regression methods can be selected for the analysis (Equation (7)). \[Y_{i}=\beta_{0}+\beta_{1}(X_{i})^{n}+\varepsilon_{i} \tag{7}\]  
\(Y_{i}\) is the estimated regression value of FR, \(\beta_{0}\) is the parameter of the intersection point of the \(y\)-axis, \(\beta_{1}\) is the slope of regression graph, \(X_{i}\) is pollutant value, \(\varepsilon_{i}\) is random error rate, \(n\) is the degree of the regression line. For \(n=1\), the solution will be linear, however, for \(n>1\) the result is solved only in the non-linear plane. We observed that the literature and many different studies, summarized in the Introduction section, generally focus on three different regression methods for the two types of problems mentioned above. Those are SVM, ANN, and MLR methods. MLR is chosen as the linear regression method rather than the classical method. The main reason for choosing the MLR method is that the number of pollutant variables is more than one (COD, TKN, and TP). Therefore, classical linear regression is not a suitable method for the problem. SVM and ANN are two commonly used techniques for non-linear regression. Some studies state that SVM is better than ANN, while some studies found the opposite. These performance differences are related to both problem types, dataset size, and dataset balance. Since the FR model we proposed is the first in the literature and therefore there is no comparable dataset, there is no definite information about which method would give better performance. However, as mentioned in the Analysis section, both methods show that the dataset has meaningful information and is highly correlated with the actual FR values. Thirty-three randomly selected soil samples that contain COD, TKN, and TP of the leachate at different time intervals are divided into train and test sets to generate FR values based on soil using 5-fold cross-validation. Cross-validation is required to select the different time intervals. The separation process of the data into train and test sets is conducted in order to test the trained regression model without overfitting. What is required here is the similarity between the regression and the actual FR values. In the regression similarity approach, the root means square error (RMSE) of the two values is subtracted from 1 and the error rate is converted to the similarity ratio (Equation (8)). \[\text{Similarity}=1-\sqrt{\frac{1}{n}\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2}} \tag{8}\]where \(n\) is the number of test size, \(y_{i}\) is the observed value for the \(i\)th observation and \(\hat{y_{i}}\) is the predicted value. In addition, \(R^{2}\) similarity analysis, which is frequently used in regression analysis, is also applied in our study. The most general definition formula for the identification coefficient (\(R^{2}\)) is:  
\[R^{2}=1-\frac{\sum_{i}(y_{i}-\hat{y_{i}}\ )^{2}}{\sum_{i}(y_{i}-\overline{y}_{i} )^{2}} \tag{9}\]  
where \(y_{i}\) is the observed value for the \(i\)th observation, \(\hat{y_{i}}\) is the predicted value and \(\overline{y}_{i}\) is the mean value of the response variable. We observed that COD, TKN, and TP as an attribute have different effects on the similarity ratio (in the range of 0 to 1 or non-similar to similar) between the value produced by regression and the actual FR values. This procedure is repeated 100 times and the average of similarity ratios is taken as the basis for the analysis.