## 3 Model Implementation
### Design of Comparison Schemes and Tuning Parameters  
Design of a comparison scheme using eight algorithm models, these eight algorithm models are HST model, support vector machine using poly kernel (SVM-poly), support vector machine using radial basis function kernel (SVM-rbf), RF model, multilayer perceptron (MLP) model, standard LSTM, the attention mechanism is coupled to the model before LSTM layer, and the attention mechanism is coupled to the model after the LSTM layer. All of the algorithms are implemented in the Python 3.6 environment. The data processing is conducted with the Numpy and Pandas packages of Python. The modelling process using MLR, SVM, and RF is carried out using the package of Scikit-Learn in Python. Our MLP and LSTM networks are developed with Keras on top of Google TensorFlow.  
For the HST model, it is essentially linear regression, and its regression coefficients are calculated by the least square method. For artificial intelligence models, each model has its own unique hyperparameters that need to be set. We introduce the method of grid search (GS) [31] to tune the hyperparameters on the data of training set. It arranges and combines the possible values of each hyperparameter from the pre-declared parameter interval, and lists all possible combinations to generate a grid. Then, use each combination for training and use ten-fold cross-validation to evaluate performance. After the fitting  
Figure 3: Flowchart of dam deformation prediction based on the coupled algorithm.  
function has tried all the parameter combinations, a best hyperparameter combination is returned. SVM-poly model has two important parameters: the penalty coefficient \(C\) and the specified degree \(d\). SVM-rbf model has two important parameters: penalty coefficient \(C\) and influence radius \(\gamma\). RF model has three important parameters: the total number of trees \(n\_estimators\), the maximum number of features a single tree can have \(max\_features\) and the minimum number of sample data owned by leaves \(min\_sample\_leaf\). In order to suppress the overfitting phenomenon of LSTM and MLP models, it is necessary to add a dropout layer. Therefore, both the MLP and LSTM models have two important parameters: the number of hidden layer units \(u\) and the dropout rate. However, different from MLP, LSTM also needs to declare the size of the sliding time window \(w\), which is how long the previous data needs to be considered when predicting the dam deformation in the next time period. Therefore, the partial autocorrelation function (PACF) of original dam deformation is calculated, as shown in Figure 4. It can be found that when the deformation lag is greater than eight, the values of PACF stabilize within the 95% confidence interval. Meanwhile, tuning the sliding time window size of the LSTM. When the optimal range of \(w\) is determined, testing the performance of the LSTM model with different values of \(w\) on the training set, and the results are shown in Figure 5. At first, due to insufficient effective information, the performance of model changes greatly. As the value of \(w\) increases, the model receives more information, which makes the performance of model gradually improve and eventually stabilize. Through Figures 4 and 5, when the LSTM model uses a larger \(w\), the performance of LSTM will not be affected by redundant information. In order to simplify the process of determining specific hysteresis of the impact factor, we can choose a larger \(w\). The final experimental results are listed in Table 1.  
Figure 4: The PACF results of the original observed data.  
Figure 5: MAE values of the LSTM model with different sliding time window size. The solid lines represent the average value from ten repeated simulations and the upper and lower boundaries of the band represent the maximum and minimum from the ten simulations.