# Spatio-Temporal Heterogeneous Ensemble Learning Method for Predicting Land Subsidence
## 2 Methods
### Heterogeneous Ensemble Learning-Based Prediction Method
#### 2.2.2 Blending-Based Ensemble Learning Strategy  
Blending [38] is a heterogeneous ensemble learning algorithm and a variant of Stacking [39]. Similar to Stacking, Blending improves overall prediction performance by combining the prediction results of multiple independent models of different types. However, Blending uses a hold-out strategy for dataset splitting during training, in contrast to the cross-validation strategy used in Stacking. The core mechanism of Blending is that by combining individual models, the advantages of each model can be fully utilized to achieve a prediction effect that exceeds that of an individual model [40]. The Blending algorithm contains two important components: base learners and a meta-learner. The base learners are a diverse set of pre-selected models. The base learners are as diverse as possible to capture the advantages of different aspects of the data. First, the base learners are trained on the training set. The meta-learner uses the prediction results of the base learner on the test set as input to learn how to best combine the predictions of the base learners, so as to combine different base learners to obtain more accurate prediction results. The four individual models for land subsidence prediction introduced in Section 2.2.1 were combined using the Blending algorithm. The flowchart of the Blending ensemble algorithm is illustrated in Figure 2.  
For the selection of meta-learners, existing ensemble learning research has shown that simple linear models can achieve good performance [41], so linear regression was selected in this study as the meta-learner. The basic mechanism involves using the prediction results of the base learners as independent variables and generating the final prediction value through linear combination, represented as follows:  
\[Y=\beta_{1}X_{1}+\beta_{2}X_{2}+\ldots+\beta_{i}X_{I}+\varepsilon \tag{15}\]  
Figure 2: Flowchart of Blending ensemble algorithm.  
where \(\beta_{i}\) represents the contribution of an individual model, i.e., the weight; \(X_{i}\) represents the predicted value of an individual model. During the training process, the weight of each base learner is determined by minimizing the prediction error. In this way, the Blending algorithm effectively combines the prediction results of different models achieving more accurate land subsidence prediction results. The four individual models are implemented in the pytorch library and the TensorFlow python library. The pseudo-code of the proposed method (Algorithm 1) is presented below.  
```
// Two-stage hybrid spatio-temporal clustering Co_clusters= BBAC_1 (LS_Mat, k, l); // first stage co_clustering using BBAC_1 algorithm Aggregated_clusters = Aggregate (LS_Mat, Co_clusters) //Aggregate each co-cluster into single object ST_clusters = REDCAP(Aggregated_clusters, k_final); // second stage clustering using REDCAP algorithm // Blending-based ensemble learning for prediction Base_models = [S2S, GCN_S2S,DCRNN, GMAN] Testing_results_all = [] for cluster in ST_clusters do  Train_set, Test_set, Validate_set = Split(cluster, split_ratio) for model in Base_models do  Trained_model = Train(model)  Testing_result = Trained_model(Test_set)  Testing_results_all.add(Testing_result) end for // Train Linear regression model for Blending ensemble Trained_LR = LR.fit(Testing_results_all)  Validating_result = Trained_LR(Validate_set) end for
```  
**Algorithm 1** Spatio-temporal ensemble predicting (LS_Mat, k, l, k_final, split_ratio)