## 2 Methods
### Methodology
#### 2.2.2 Restoration Method  
For the single outlier data in the data for the elevation of pipeline (i.e., one-dimensional data), the mean method is used to restore it, and for the continuous outliers, the machine learning prediction model is used to restore it. For the water level data, the prediction model of each cluster is established to restore water level data. MLR, RF, ANN, GBDT and SVM are used as prediction models. The algorithm works as follows:  
SVM is a supervised machine learning algorithm that can be used for the classification of discrete dependent variables and the prediction of continuous dependent variables. In general, this algorithm will have better prediction accuracy than other single classification algorithms, mainly because it can convert a low-dimensional linearly indivisible space to a high-dimensional linearly separable space by the kernel function. For the nonlinear SVM model, it is necessary to go through two steps; one is to map the sample points in the original space to the new space of high latitude, and the other is to find a linear \"hyperplane\" in the new space for identifying various sample points. Common Liner kernel functions:  
\[\mathrm{K}\big{(}\mathrm{x_{i},\ x_{j}}\big{)}=\mathrm{x_{i}\cdot x_{j}} \tag{3}\]  
Polynomial kernel functions:  
\[\mathrm{K}\big{(}\mathrm{x_{i},\ x_{j}}\big{)}=\big{(}\gamma\big{(}\mathrm{x_{ i}\cdot x_{j}}\big{)}+\mathrm{r}\big{)}^{\mathrm{P}} \tag{4}\]  
RBF kernel functions:  
\[\mathrm{K}\big{(}\mathrm{x_{i},\ x_{j}}\big{)}=\mathrm{e}^{(-\gamma\|\mathrm{ x_{i}}-\mathrm{x_{j}}\|^{2})} \tag{5}\]  
Sigmoid kernel functions:  
\[\mathrm{K}\big{(}\mathrm{x_{i},\ x_{j}}\big{)}=\mathrm{\,tan\,h}\big{(} \gamma\big{(}\mathrm{x_{i}\cdot x_{j}}\big{)}+\mathrm{r}\big{)} \tag{6}\]  
In practical applications, the selection of kernel functions is the key to the calculation of support vector machine models. Thus, it is important to combine prior domain knowledge with a cross-validation method to elect a reasonable kernel function. The SVM method has been applied in many fields due to its strong applicability and simple process. RF is a tree-based algorithm, which builds multiple classification trees and fuses their results to obtain better performance. The results of all decision trees are averaged as the final prediction result of the model for regression problems. Random forest adopts the idea of Bootstrap aggregating (Bagging) in ensemble learning. It randomly extracts samples and features from the sample set and trains a tree based on them, making each tree in the forest unique and different. Random forests are efficient because the trees can be run in parallel, and they overcome the instability problem of a single decision tree. In addition, random forests can handle high-dimensional datasets with high accuracy. The specific calculation steps of RF are as follows:  
1. Construct N decision trees from original samples by Bootstrap method;
2. Select M features in the m dimension and select the best features as split nodes to establish different decision trees, where m < M;
3. Do not prune the decision tree, so as to ensure that the decision tree grows as much as possible;
4. Calculate the average value from the results of each decision tree as the final output result of the random forest, as shown in Equation (7). \[\mathrm{F_{RF}(X)}=\frac{1}{\mathrm{N}}\sum_{\mathrm{L}}^{\mathrm{N}}\mathrm{T_ {k}(x)} \tag{7}\]  
GBDT is an iterative decision tree algorithm, which is composed of multiple decision trees, and the final result is made by summing up the results of all trees. The tree in GBDT is a regression tree, not a classification tree, and GBDT is mainly used for regression prediction. In the training process, it uses the non-positive gradient of loss function as the approximation of the foundation model loss in the mth round of the foundation model, and then uses this approximation value to build the next round of the foundation model.