## 2 Materials and Methods
### Methods
#### 2.2.2 Random Forest Classification Algorithm  
The Random Forest model operates by performing random sampling on both the training data and the explanatory variables to generate multiple decision trees. Afterward, it aggregates the predictions from each tree to produce a final result. For regression problems, this aggregation is performed by averaging the predictions, while for classification problems, the mode of the predictions is taken as the final class label. In this study, we selected k = 100 as the number of classification trees and calculated the model accuracy (such as overall accuracy and Kappa coefficient) for each k value through cross-validation, ultimately choosing the k value that maximized the model accuracy. For the number of predictor variables m used in each tree, we chose m = sqrt(p), where p is the total number of features. This is the default setting for Random Forest, which has been proven to perform well in many classification problems [33]. Random Forest has several importantcharacteristics, such as resistance to overfitting [33], strong noise tolerance, and high interpretability [55]. These qualities make it a popular choice for a variety of predictive tasks [56; 57]. The feature vector calculation for each decision tree in the Random Forest can be expressed by the following formula [58; 59]:  
\[\min\mathrm{j},\mathrm{m}\left[\sum_{\mathrm{q}\mathrm{i}\in\mathrm{R}\mathrm{I} \left(\mathrm{j}\mathrm{m}\right)}\left(\mathrm{q}\mathrm{i}-\mathrm{\hat{q} }\mathrm{R}\mathrm{I}\right)^{2}+\sum_{\mathrm{q}\mathrm{i}\in\mathrm{R} \mathrm{Z}\left(\mathrm{j}\mathrm{m}\right)}\left(\mathrm{q}\mathrm{i}-\mathrm{ \hat{q}}\mathrm{R}\mathrm{Z}\right)^{2}\right] \tag{1}\]  
\[\mathrm{\hat{q}}\mathrm{R}\mathrm{I}=\mathrm{mean}\left[\mathrm{q}\mathrm{i} \middle|\mathrm{q}\mathrm{i}\in\mathrm{R}\mathrm{I}\left(\mathrm{j},\mathrm{m} \right)\right] \tag{2}\]  
\[\mathrm{\hat{q}}\mathrm{R}\mathrm{I}=\mathrm{mean}\left[\mathrm{q}\mathrm{i} \middle|\mathrm{q}\mathrm{i}\in\mathrm{R}\mathrm{Z}\left(\mathrm{j},\mathrm{m} \right)\right] \tag{3}\]  
In the formula, \(\mathrm{j}\) and \(\mathrm{m}\) represent the feature attributes of the decision tree, \(\mathrm{R}\mathrm{I}\left(\mathrm{j},\mathrm{m}\right)\) denotes the subset of samples in the first child node obtained by splitting at node \(\mathrm{j}\) using feature \(\mathrm{m}\), and \(\mathrm{R}\mathrm{2}\left(\mathrm{j},\mathrm{m}\right)\) denotes the subset of samples in the second child node obtained by splitting at node \(\mathrm{j}\) using feature \(\mathrm{m}\). \(\mathrm{q}\mathrm{i}\) represents the actual target value of the \(\mathrm{i}\)-th sample, while \(\mathrm{\hat{q}}\mathrm{R}\mathrm{I}\) and \(\mathrm{\hat{q}}\mathrm{R}\mathrm{Z}\) are the predicted target values for \(\mathrm{R}\mathrm{I}\) and \(\mathrm{R}\mathrm{Z}\), respectively. The purpose of this formula is to identify the split point that minimizes the sum of the mean squared errors of the two child nodes, ensuring that the child nodes post-split exhibit maximum purity, i.e., minimizing the variance of the target values within each child node. This approach enables each decision tree in the random forest to effectively split the data, thereby enhancing the model's predictive accuracy [33].