# Analysis of Weighted Factors Influencing Submarine Cable Laying Depth Using Random Forest Method
## 2 Materials and Methods
### Random Forest and Pearson Correlation Analysis  
Random forest is an ensemble learning algorithm based on decision trees, which can effectively perform feature selection when dealing with high-dimensional data [18]. In terms of feature selection and ranking, random forest provides methods to quantify feature importance. Specifically, there are two commonly used methods for calculating feature importance in random forest:  
1. Mean Impurity Decrease: When constructing decision trees, each split reduces the impurity (such as the Gini index or information entropy) of a certain feature. For each feature, the total impurity decreases it generates across all trees can be calculated, and then this value is divided by the number of trees in the forest to obtain the average impurity decrease for that feature. A higher average impurity decrease indicates that the feature is more important in predicting the target variable.
2. Mean Accuracy Decrease: This method involves calculating the prediction accuracy of the random forest model and then performing a permutation importance test on each feature. Specifically, for each feature, its values in the dataset are randomly permuted, and the model's prediction accuracy is recalculated using the permuted dataset. The extent of the accuracy decrease can serve as a measure of feature importance. A larger accuracy decrease implies that the feature is more important in predicting the target variable.  
Random forest offers several advantages in feature selection: it can handle high-dimensional datasets, exhibits good robustness, captures complex nonlinear relationships between features, provides intuitive and interpretable measures for feature selection and ranking, and handles outliers well. In practical applications, the feature selection methods of random forest have been widely used in fields such as data mining, machine learning, and image processing. Furthermore, random forest has the advantages of adaptability, fast training speed, and ease of parallelization, making it a popular feature selection method in various application scenarios [19].  
When building machine learning models, high correlation between features may lead to the following issues: (a) multicollinearity, which makes the model sensitive to small changes in the data, increasing variance and decreasing reliability; (b) overfitting, where the model performs well on the training set but poorly on unseen data due to considering the correlation between features; (c) difficulty in assessing feature importance, as highly correlated features make it challenging to accurately evaluate the importance of each feature. Therefore, conducting feature correlation analysis using Pearson correlation analysis is a crucial step in data preprocessing [20; 21; 22]. Hence, the introduction of Pearson correlation analysis is used to assess the correlation among different indicators.  
The Pearson correlation coefficient ranges between \(-1\) and \(1\), where a value of \(1\) indicates a perfect positive correlation between two variables, a value of \(-1\) indicates a perfect negative correlation, and a value of \(0\) indicates no linear correlation between the variables.  
The Pearson correlation coefficient can be calculated using the following formula:  
\[r=\big{(}n\sum xy-\sum x\sum y\big{)}/\sqrt{\big{[}n\sum x^{2}-\big{(}\sum x \big{)}^{2}\big{]}\times\big{[}n\sum y^{2}-\big{(}\sum y\big{)}^{2}\big{]}} \tag{2}\]  
where \(r\) represents the Pearson correlation coefficient, \(n\) represents the sample size, and \(x\) and \(y\) are the respective factors influencing two variables. The resulting correlation heatmap is shown in Figure 1.