# GNSS-IR Soil Moisture Retrieval Using Multi-Satellite Data Fusion Based on Random Forest
## 2 Methodology
### Principles of MDI-Based Random Forest Retrieval  
The Random Forest (RF) model is a potent machine learning method [16], extensively utilized for classification and regression tasks. It represents a form of ensemble learning that improves the accuracy and stability of predictions by combining multiple decision trees. During the modeling process, the bootstrap sampling method is employed to select multiple satellites from all available satellite data to construct several sample sets, thereby reducing the risk of data overfitting. Subsequently, a specified number of decision trees are generated, and the results predicted by these trees are integrated to form a more robust prediction outcome [17; 18]. The decision tree is a supervised learning algorithm, the sample set of the decision tree is randomly selected from all visible satellite arcs with the put-back by bootstrap sampling method as the sample set so that all satellite arcs have the chance to appear multiple times in the training set of the same tree. The satellite data that are not selected as the training set are called \"out-of-bag\" (OOB) data, and the prediction of each tree on its OOB samples can be used to evaluate the error of this tree, which is equivalent to a built-in cross-validation process. During the training process of the decision tree, the sample set is divided into subsets by selecting the satellite arc segments that maximize the reduction of impurity as the optimal segmentation points until the stopping condition is satisfied. Finally, the decision tree makes predictions based on the tree structure constructed during the training process. The Mean Decrease in Impurity (MDI) algorithm is a feature selection method used to identify the optimal splitting feature during the node splitting process in decision trees. In regression problems, the Mean Squared Error (MSE) is commonly employed as a measure of impurity. MSE reflects the dispersion of samples within a node, i.e., the average difference between predicted values and actual values. For a node containing \(N\) samples, where the target variable is denoted as \(y_{i}\) (\(i=1,2,\ldots,N\)), the mean squared error of the node is defined as follows:  
\[MSE=\frac{1}{N}\sum_{i=1}^{N}(y_{i}-\overline{y})^{2}, \tag{4}\]  
herein, \(\overline{y}\) represents the mean value of the target variable for all samples within the node. During the model training process, the model randomly selects a subset of features from the sample set as candidate splitting features, enhancing the model's diversity and generalization capability. For each candidate splitting feature, the model explores various split points within its range of values. For each potential split point, the original node is divided into a left node and a right node, with the MSE for the left and right nodes represented as \(MSE_{l}\) and \(MSE_{r}\), respectively. The overall MSE after splitting, denoted as \(MSE_{s}\), is subsequently calculated as a weighted sum of \(MSE_{l}\) and \(MSE_{r}\). \[MSE_{s}=\frac{N_{l}}{N}MSE_{l}+\frac{N_{r}}{N}MSE_{r}, \tag{5}\]  
wherein, \(N_{l}\) denotes the number of samples in the left node, and \(N_{r}\) represents the number of samples in the right node. Subsequently, the decrease in impurity before and after the split, \(\Delta MSE\), also known as the mean decrease in impurity, is calculated as follows:  
\[\Delta MSE=MSE-MSE_{s} \tag{6}\]  
In the final step, from all the candidate segments and corresponding partition points, select the feature and partition point that maximizes the reduction in \(\Delta MSE\) as the definitive partition choice for that node. This principle is used to split the nodes and construct the decision tree until the stopping conditions are met. Finally, the reductions in \(\Delta MSE\) for each segment across all node splits are cumulatively added to determine the importance of each segment.