Method for predicting submarine shallow gas escape process under hydrodynamic action based on random forest
Through a random forest-based method, combined with marine environmental data and correlation analysis, a shallow gas escape prediction model is constructed, which solves the problems of low prediction accuracy and inconsistent with the actual situation in the existing technology, and realizes shallow seabed layer in the seabed Effective quantitative prediction of qi egress and explanation of influencing factors.
Patent Information
- Application Number
- CN202411256820.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-09
AI Technical Summary
The prior art lacks effective quantitative prediction methods and ideal models to describe the impact of hydrodynamic effects on the escape of shallow gas in the seabed, resulting in low prediction accuracy and the actual situation does not match the model.
Using a random forest-based method, the marine environment data was collected and preprocessed, and the characteristics were screened using Spearman rank correlation analysis, and the random forest model was constructed, and the model performance and feature contribution were evaluated through the k-fold cross-validation and feature importance analysis module. , realize quantitative prediction of shallow gas escape from seabed.
The prediction accuracy is improved, and combined with correlation analysis and characteristic importance analysis, the contribution of each hydrodynamic factor to shallow gas egress is quantified, and the prediction efficiency and model explanatory nature are enhanced.
Smart Images

Figure CN119202927A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of random forest and seabed shallow gas escape prediction, and in particular to a method for predicting a seabed shallow gas escape process under the hydrodynamic effect based on random forest. Background Art
[0002] Submarine gas is a natural gas resource with methane as the main component that exists in seabed sediments. Its escape will pose a serious threat to marine engineering construction, seriously endanger human life and property safety, and destroy the marine ecological balance. The continuous action of hydrodynamics is an important factor inducing the escape of shallow seabed gas. Tides and waves can change the pressure difference between the inside and outside of the seabed in the shallow gas storage area. When the internal and external gradient of shallow gas-containing sediments reaches a threshold, it will cause gas escape, accompanied by the resuspension of seabed sediments. The duration and intensity of ocean currents will have a direct dynamic impact on methane leakage in shallow sediments. The contribution degree and comprehensive influence mechanism of various hydrodynamic elements to the escape of shallow seabed gas are still unclear.
[0003] At present, the research on the impact of hydrodynamics on shallow seabed gas release mainly includes qualitative research and quantitative research on the establishment of gas migration models through numerical simulation. The above research lacks quantitative prediction methods for shallow seabed gas release and the ideal model does not match the actual situation. Machine learning can analyze massive amounts of data and learn rules from them. It has become a popular data analysis and prediction method. In recent years, it has also been applied to the identification of shallow seabed gas and the prediction of gas release.
[0004] Common machine learning methods mainly include: random forest, support vector machine and neural network, etc., which can reveal the potential complex relationship between multiple features through training and learning of data sets, simulate the dependency relationship between independent variables and dependent variables, and thus establish a more accurate prediction model. Summary of the invention
[0005] In order to make up for the shortcomings of the existing technology and overcome the problems that the existing research lacks a quantitative prediction method for shallow gas escape and the ideal modeling does not match the actual situation, the present invention provides a method for predicting the shallow gas escape process under the hydrodynamic action of the seabed based on random forest.
[0006] The present invention is implemented by the following technical scheme: a method for predicting the process of shallow seabed gas escape under the hydrodynamic effect of random forest, which specifically includes the following steps: Step S1, collecting in-situ monitoring data of water environment elements such as temperature, waves, tides, currents and pressure in the shallow gas storage area and methane concentration data of the bottom water, reading the measured temperature, effective wave height, effective wave period, seabed pressure, ADV echo intensity, flow velocity in the three directions of u / v / w and methane concentration data of the bottom water; Step S2, preprocessing the above data including cleaning, filling missing values, and interpolation; Step S3, further screening the input features according to the results of the correlation analysis, and using the bottom water methane concentration value as the target variable; The calculation formula of Spearman rank correlation coefficient is: in, is the Spearman rank correlation coefficient, and They are the m(n)th values of the i(j)th column feature after the feature data of each column are arranged in order of size. and The ranking, and are the ranks of the average values of the features in the i(j)th column respectively; Step S4: Divide all data sets into training sets and test sets according to a certain ratio, and standardize the input variables in each subset; The standardized calculation formula is: Among them, x is the original data, is the mean of the feature, is the standard deviation of the feature; Step S5, construct a random forest model and set model parameters, including: the maximum depth of the decision tree max_depth, the number of weak learners n_estimators, the minimum number of samples of leaf nodes min_samples_leaf, the random state parameter random_state, the minimum number of samples required at the leaf node min_samples_leaf, and the number of randomly selected features of each decision tree max_features; Step S6: Bring the training set into the model training and use the test set to verify the model accuracy. The evaluation criteria include: determination coefficient R 2 , mean absolute error MAE, mean square error MSE, root mean square error RMSE and mean absolute percentage error MAPE.
[0007] The formula for calculating the coefficient of determination is: The mean absolute error is calculated as: The formula for calculating the mean square error is: The formula for calculating the root mean square error is: The mean absolute percentage error is calculated as: in, is the true observed value, is the predicted value, is the mean of the true observations; Step S7: Use k-fold cross validation method to verify whether the model is overfitting; Step S8: Use the feature importance analysis module of the random forest and Shapley's addition and interpretation to quantify and rank the contribution of each feature variable and analyze the results.
[0008] As a preferred solution, in step S1, the average absolute value of the echo intensity in each direction measured by ADV is used to represent the real-time turbidity.
[0009] As a preferred solution, the temperature, effective wave height, effective wave period, seabed pressure, and methane concentration data measured by the wave and tide meter in step S2, the turbidity data calculated in step S1, and the flow rate data measured by the 2M ADCP are interpolated.
[0010] As a preferred solution, the Spearman rank correlation coefficient between the characteristic variables is calculated in step S3, and each characteristic data is arranged in order of size, each data will correspond to a rank, and by comparing the difference changes of the variables, it can be judged whether there is a correlation between the changing trends of the two variables. When the Spearman rank correlation coefficient is close to 0, it indicates that the two variables are almost not affected by the trend of mutual change, and when the coefficient is close to 1 or -1, it indicates that the changing trends of the two variables are monotonic. Eliminate one of the variables with higher correlation, and the remaining variables are integrated into the characteristic variables.
[0011] As a preferred solution, in step S4, the data set is divided into a training set and a test set in a ratio of 9:1 according to experience. Standardizing the feature variables in each subset can reduce the impact of dimensional differences between variables and avoid the influence of test set data during model training, thereby improving model stability and reducing the overestimation of feature importance. In addition, the target variable is not standardized, eliminating the final step of de-standardizing the results.
[0012] As a preferred solution, the random forest regression function is called in step S5 for modeling. The model parameters include: the maximum depth of the decision tree max_depth, the number of weak learners n_estimators, the minimum number of samples of leaf nodes min_samples_leaf, the random state parameter random_state, the minimum number of samples required at the leaf nodes min_samples_leaf, and the number of randomly selected features of each decision tree max_features. In this code, the number of weak learners n_estimators and the random state parameter random_state are set, and the remaining parameters are default settings.
[0013] As a preferred solution, step S6 specifically includes the following steps: Step S6-1: construct a random forest model to generate m decision trees. When constructing the i-th decision tree, randomly extract samples from the training set with replacement to form a sample subset L i , train the i-th decision tree on the sample subset, and the samples that do not participate in the training of this decision tree become out-of-bag data O i ; Step S6-2, the sample subsets are split in sequence at the root node along the decision tree according to the feature variables until the number of samples at the leaf node is less than 1 or the depth of the decision tree reaches a set value; Step S6-3: Use the out-of-bag data to calculate the out-of-bag error of the i-th decision tree, denoted as err0 i , the error continues to converge until the end of training; Step S6-4: taking the average value of the prediction results of multiple decision trees as the final prediction value.
[0014] As a preferred solution, in step 7, the data set is evenly divided into 10 folds, and each fold is used as a test set in turn to compare the accuracy of the prediction results. If the accuracy is not much different, it indicates that the model is not overfitting.
[0015] As a preferred solution, step S8 specifically includes the following steps: Step S8-1, call the random forest module to calculate the feature importance, the principle is to randomly perform i The kth feature variable X k Add noise interference and calculate the out-of-bag error again, which is different from the original out-of-bag error errO i The difference between represents the contribution of the feature to the result, so the feature variable X k The contribution of all trees is the average difference between the sum , sort the feature variables X in the random forest model in descending order of contribution; Feature variable X k The calculation formula for the contribution of the i-th tree is as follows: in, is the number of observations of the OOB data of the i-th tree, I(g) is the indicator function, that is, it takes 1 when the two values are equal and 0 when they are not equal. is the true value of the pth observation in the OOB data, is the predicted value of the i-th decision tree for the p-th observation in the OOB data before random permutation, is the predicted value of the pth observation in the OOB data by the i-th decision tree after random permutation; Feature variable X k The calculation formula for contribution in random forest is as follows: Where n is the number of decision trees in the random forest; Step S8-2, each predicted value can be regarded as the sum of the mean of the target variable and the shap value of each feature variable. If the shap value is positive, it means that the feature promotes the prediction result, and vice versa. Call the shap library to calculate the shap value of each sample value, that is, calculate the marginal contribution of a feature value when it is added to the model, take the marginal contribution of all feature values in the feature column and take the average value to get the contribution of the feature, and sort according to the importance; The shap value calculation formula is as follows: Among them, the weighting factor represents the possibility of different combinations, and the specific calculation formula is as follows: in, For a feature X k The shap value is the contribution, N represents the set of all feature variables involved, Represents the number of elements in the set in which all feature variables participate. S is a subset of N. is the number of elements in the subset of N, represents the contribution of combination S, Remove feature X from the set k After the collection, To remove feature X k After the contribution, For feature X k marginal contribution; Step S8-3: Compare the two sorting analyses to find the key factors affecting shallow gas release, and draw a characteristic density scatter plot and a partial dependence plot based on the shap value.
[0016] Due to the adoption of the above technical solution, the present invention has the following beneficial effects compared with the prior art: (1) The present invention combines correlation analysis to comprehensively consider a variety of hydrodynamic factors, quantitatively analyzes the contribution of each factor to the shallow gas escape result, and has good prediction accuracy; (2) The present invention uses correlation analysis to screen independent variables to improve prediction efficiency, and uses Shapley addition and interpretation to analyze the results to enhance the interpretability of machine learning.
[0017] Additional aspects and advantages of the present invention will become apparent from the following description or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which: Figure 1 This is a flow chart of a method for predicting the process of gas escape from shallow seabed under the hydrodynamic effect based on machine learning of the present invention; Figure 2 Heatmap for correlation analysis; Figure 3 This is a diagram of the working principle of random forest; Figure 4 This is a comparison chart of the predicted values and actual values in the test set; Figure 5 Random forest feature importance ranking graph; Figure 6 It is the shap value feature contribution ranking diagram; Figure 7 It is a shap value (macro) feature density scatter plot; Figure 8 This is the shap value partial dependence diagram. DETAILED DESCRIPTION
[0019] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0020] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0021] The present invention specifically analyzes the influence of various hydrodynamic effects on the escape of shallow seabed gas, proposes a prediction method for the process of shallow seabed gas escape under the hydrodynamic effect based on random forest, and quantifies the importance of each input feature. Figures 1 to 6 The method for predicting the process of shallow seabed gas escape under the hydrodynamic effect of random forest in an embodiment of the present invention is specifically described.
[0022] like Figure 1 As shown, the following steps are included: Step S1, in this embodiment, the in-situ monitoring data of the shallow gas storage area in Zhoushan, China is taken as an example, the acquired data is processed, and the temperature, effective wave height, effective wave period, seabed pressure, echo intensity, flow velocity in three directions of u / v / w and methane concentration data of the bottom water are extracted. Among them, the echo intensity is the sum of the signal strengths in the three directions of u / v / w measured by ADV.
[0023] Step S2: pre-process the data by cleaning, filling in missing values, and interpolating.
[0024] Step S3: perform correlation analysis on the data in the embodiment, and the correlation heat map is as follows: Figure 2 As shown, the input features are further screened according to the results, and the methane concentration value of the bottom water body is the target variable. Considering the high correlation between temperature and seabed pressure and the target variable and the research purpose is the influence of hydrodynamic effects on the escape of shallow seabed gas, and the low dependence between features, all features are retained as input variables.
[0025] The calculation formula of Spearman rank correlation coefficient is: in, is the Spearman rank correlation coefficient, and They are the m(n)th values of the i(j)th column feature after the feature data of each column are arranged in order of size. and The ranking, and are the ranks of the average values of the features in the i(j)th column.
[0026] Step S4: According to experience, the data set is divided into a training set and a test set at a ratio of 9:1. Standardizing the feature variables in each subset can reduce the impact of the difference in dimensions between variables and avoid the influence of the test set data during model training, thereby improving the stability of the model and reducing the overestimation of feature importance. In addition, the target variable is not standardized, and the final step of de-standardizing the result is omitted.
[0027] The standardized calculation formula is: Among them, x is the original data, is the mean of the feature, is the standard deviation of the feature.
[0028] Step S5, construct a random forest model and set model parameters, including: the maximum depth of the decision tree max_depth, the number of weak learners n_estimators, the minimum number of samples of leaf nodes min_samples_leaf, the random state parameter random_state, the minimum number of samples required at the leaf nodes min_samples_leaf, and the number of randomly selected features of each decision tree max_features. The embodiment trains and determines that the number of weak learners n_estimators is 100 and the random state parameter random_state is 0, and the remaining parameters are default settings.
[0029] Step S6: Bring the training set into model training. The model works as follows: Figure 3 As shown, the specific steps are as follows: Step S6-1, construct a random forest model to generate m decision trees. When constructing the i-th decision tree, randomly extract samples from the training set with replacement to form a sample subset Li, train the i-th decision tree on the sample subset, and the samples that do not participate in the training of this decision tree become out-of-bag data Oi; Step S6-2, the sample subsets are split in sequence at the root node along the decision tree according to the feature variables until the number of samples at the leaf node is less than 1 or the depth of the decision tree reaches a set value; Step S6-3, use the out-of-bag data to calculate the out-of-bag error of the i-th tree, denoted as errOi, and the error continues to converge until the training is completed; Step S6-4: The average value of the prediction results of multiple decision trees is taken as the final prediction value. The comparison diagram between the prediction value and the actual value in the test set of the embodiment is as follows: Figure 4 As shown; Step S6-5, using the test set to verify the accuracy of the model, the evaluation criteria used include: determination coefficient R2, mean absolute error MAE, mean square error MSE, root mean square error RMSE and mean absolute percentage error MAPE. The prediction performance evaluation results of the embodiment are shown in Table 1.
[0030] surface Model prediction performance evaluation table Performance Evaluation <![CDATA[R 2 ]]> MAE MSE RMSE MAPE The present invention 0.989 0.462 2.044 1.430 1.478 The formula for calculating the coefficient of determination is: The mean absolute error is calculated as: The formula for calculating the mean square error is: The formula for calculating the root mean square error is: The mean absolute percentage error is calculated as: in, is the true observed value, is the predicted value, is the mean of the true observations.
[0031] Step S7, use the k-fold cross validation method to verify whether the model is overfitting, divide the training set into 10 folds on average, and use each fold as a validation set to compare the accuracy of the prediction results. This embodiment goes through all combinations and verifies that the accuracy rates obtained are all within the range of 0.974~0.996, which is not much different, indicating that the model is not overfitting.
[0032] Step S8: Use the feature importance analysis module of random forest and shap sum interpretation to quantify the contribution of each feature variable and sort it, and analyze the results. The specific steps are as follows: Step S8-1, call the random forest module to calculate the feature importance, the principle is to randomly perform i The kth feature variable X k Add noise interference and calculate the out-of-bag error again, which is different from the original out-of-bag error errO i The difference between represents the contribution of the feature to the result, so the feature variable X k The contribution of all trees is the average difference between the sum , sort the feature variables X in the random forest model in descending order of contribution, and the results are as follows Figure 5 As shown; Feature variable X k The calculation formula for the contribution of the i-th tree is as follows: in, is the number of observations of the OOB data of the i-th tree, I(g) is the indicator function, that is, it takes 1 when the two values are equal and 0 when they are not equal. is the true value of the pth observation in the OOB data, is the predicted value of the i-th decision tree for the p-th observation in the OOB data before random permutation, is the predicted value of the pth observation in the OOB data by the i-th decision tree after random permutation; Feature variable Xk The calculation formula for contribution in random forest is as follows: Where n is the number of decision trees in the random forest; Step S8-2: Each predicted value can be regarded as the sum of the mean of the target variable and the shap value of each feature variable. If the shap value is positive, it means that the feature promotes the prediction result, and vice versa. Call the shap library to calculate the shap value of each sample value, that is, calculate the marginal contribution of a feature value when it is added to the model. Take the marginal contribution of all feature values in the feature column and take the average value to get the contribution of the feature. Sort them according to the importance. The result is as follows: Figure 6 As shown; The shap value calculation formula is as follows: Among them, the weighting factor represents the possibility of different combinations, and the specific calculation formula is as follows: in, For a feature X k The shap value is the contribution, N represents the set of all feature variables involved, Represents the number of elements in the set in which all feature variables participate. S is a subset of N. is the number of elements in the subset of N, represents the contribution of combination S, Remove feature X from the set k After the collection, To remove feature X k After the contribution, For feature X k marginal contribution.
[0033] Step S8-3, compare the two sorting analyses of the key factors affecting shallow gas escape, and draw the characteristic density scatter plot and partial dependence plot according to the shap value as shown in the figure below: Figure 7 , Figure 8 shown.
[0034] In summary, the method of the present invention has good prediction performance in the prediction of shallow seabed gas escape, and quantitatively explains the influence weights of various hydrodynamic effects on shallow gas escape.
[0035] In the description of this specification, the description of the terms "one embodiment", "some embodiments", "specific embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0036] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for predicting the process of shallow seabed gas release under the hydrodynamic effect based on random forest, characterized in that: The specific steps include: Step S1: Collect in-situ monitoring data of water environment elements such as temperature, waves, tides, currents and pressure in the shallow gas storage area and methane concentration data of the bottom water body, and read the measured temperature, effective wave height, effective wave period, seabed pressure, ADV echo intensity, flow velocity in the three directions of u / v / w and methane concentration data of the bottom water body; Step S2: preprocessing the above data including cleaning, filling missing values and interpolation; Step S3: further screen the input features according to the results of the correlation analysis, and use the bottom water methane concentration value as the target variable; The formula for calculating the Spearman rank correlation coefficient is: in, is the Spearman rank correlation coefficient, and They are the m(n)th values of the i(j)th column feature after the feature data of each column are arranged in order of size. and The ranking, and are the ranks of the average values of the features in the i(j)th column respectively; Step S4: Divide all data sets into training sets and test sets according to a certain ratio, and standardize the input variables in each subset; The standardized calculation formula is: Among them, x is the original data, is the mean of the feature, is the standard deviation of the feature; Step S5: Build a random forest model and set model parameters, including: the maximum depth of the decision tree max_depth, the number of weak learners n_estimators, the minimum number of samples of leaf nodes min_samples_leaf, the random state parameter random_state, the minimum number of samples required at the leaf node min_samples_leaf, and the number of randomly selected features of each decision tree max_features; Step S6: Bring the training set into the model training and use the test set to verify the model accuracy. The evaluation criteria include: determination coefficient R 2 , mean absolute error MAE, mean square error MSE, root mean square error RMSE and mean absolute percentage error MAPE; The formula for calculating the coefficient of determination is: The mean absolute error is calculated as: The formula for calculating the mean square error is: The formula for calculating the root mean square error is: The mean absolute percentage error is calculated as: in, is the true observed value, is the predicted value, is the mean of the true observations; Step S7: Use the k-fold cross validation method to verify whether the model is overfitting; Step S8: Use the feature importance analysis module of random forest and shap sum interpretation to quantify and rank the contribution of each feature variable and analyze the results.
2. The method for predicting the process of shallow seabed gas release under the hydrodynamic effect based on random forest according to claim 1 is characterized in that: In the step S1, the average absolute value of the echo intensity in each direction measured by ADV is used to represent the real-time turbidity.
3. The method for predicting the process of shallow seabed gas release under the hydrodynamic effect based on random forest according to claim 1 is characterized in that: In step S2, interpolation processing is performed on the temperature, effective wave height, effective wave period, seabed pressure, and methane concentration data measured by the wave and tide meter, the turbidity data calculated in step 1, and the flow rate data measured by the 2M ADCP.
4. The method for predicting the process of shallow seabed gas release under the hydrodynamic effect based on random forest according to claim 1 is characterized in that: In step S3, the Spearman rank correlation coefficient between each pair of feature variables is calculated, and each feature data is arranged in order of size. Each data will correspond to a rank, and by comparing the difference in the variables, it can be determined whether there is a correlation between the change trends of the two variables; when the Spearman rank correlation coefficient is close to 0, it indicates that the two variables are almost unaffected by the trend of mutual change, and when the coefficient is close to 1 or -1, it indicates that the change trends of the two variables are monotonic; one of the variables with higher correlation is eliminated, and the remaining variables are integrated as feature variables.
5. The method for predicting the process of shallow seabed gas release under the hydrodynamic effect based on random forest according to claim 1 is characterized in that: In step S4, the data set is divided into a training set and a test set in a ratio of 9:1 according to experience. Standardizing the feature variables in each subset can reduce the impact of dimensional differences between variables and avoid the influence of test set data during model training, thereby improving the model stability and reducing the overestimation of feature importance. In addition, the target variable is not standardized, eliminating the final step of de-standardizing the results.
6. The method for predicting the process of shallow seabed gas release under the hydrodynamic effect based on random forest according to claim 1, characterized in that: In step S5, the random forest regression function is called to model the model, and the model parameters include: the maximum depth max_depth of the decision tree, the number of weak learners n_estimators, the minimum number of samples of leaf nodes min_samples_leaf, the random state parameter random_state, the minimum number of samples required at the leaf nodes min_samples_leaf, and the number of randomly selected features max_features for each decision tree. In this code, the number of weak learners n_estimators and the random state parameter random_state are set, and the remaining parameters are default settings.
7. The method for predicting the process of shallow seabed gas release under the hydrodynamic effect based on random forest according to claim 1, characterized in that: In step S5, the random forest regression function is called to model the model, and the model parameters include: the maximum depth max_depth of the decision tree, the number of weak learners n_estimators, the minimum number of samples of leaf nodes min_samples_leaf, the random state parameter random_state, the minimum number of samples required at the leaf nodes min_samples_leaf, and the number of randomly selected features max_features for each decision tree. In this code, the number of weak learners n_estimators and the random state parameter random_state are set, and the remaining parameters are default settings.
8. The method for predicting the process of shallow seabed gas release under the hydrodynamic effect based on random forest according to claim 1, characterized in that: The step S6 specifically comprises the following steps: Step S6-1: construct a random forest model to generate m decision trees. When constructing the i-th decision tree, randomly extract samples from the training set with replacement to form a sample subset L i , train the i-th decision tree on the sample subset, and the samples that do not participate in the training of this decision tree become out-of-bag data O i ; Step S6-2, the sample subsets are split in sequence at the root node along the decision tree according to the characteristic variables until the number of samples at the leaf node is less than 1 or the depth of the decision tree reaches a set value; Step S6-3: Use the out-of-bag data to calculate the out-of-bag error of the j-th decision tree, denoted as err0 i , the error continues to converge until the end of training; Step S6-4: taking the average value of the prediction results of multiple decision trees as the final prediction value.
9. The method for predicting the process of shallow seabed gas release under the hydrodynamic effect based on random forest according to claim 1, characterized in that: In step S7, the data set is evenly divided into 10 folds, and each fold is used as a test set in turn to compare the accuracy of the prediction results. If the accuracy is not much different, it indicates that the model is not overfitting.
10. The method for predicting the process of shallow seabed gas release under the hydrodynamic effect based on random forest according to claim 1, characterized in that: The step S8 specifically includes the following steps: Step S8-1, call the random forest module to calculate the feature importance, the principle is to randomly perform i The kth feature variable X k Add noise interference and calculate the out-of-bag error again, which is different from the original out-of-bag error errO i The difference between represents the contribution of the feature to the result, so the feature variable X k The contribution of all trees is the average difference between the sum , sort the feature variables X in the random forest model in descending order of contribution; Feature variable X k The calculation formula for the contribution of the i-th tree is as follows: in, is the number of observations of the OOB data of the i-th tree, I(g) is the indicator function, that is, it takes 1 when the two values are equal and 0 when they are not equal. is the true value of the pth observation in the OOB data, is the predicted value of the i-th decision tree for the p-th observation in the OOB data before random permutation, is the predicted value of the pth observation in the OOB data by the i-th decision tree after random permutation; Feature variable X k The calculation formula for contribution in random forest is as follows: Where n is the number of decision numbers in the random forest; Step S8-2, each predicted value can be regarded as the sum of the mean of the target variable and the Shapley value of each feature variable. If the Shapley value is positive, it means that the feature promotes the prediction result, and vice versa; call the shap library to calculate the shap value of each sample value, that is, calculate the marginal contribution of a feature value when it is added to the model, take the marginal contribution of all feature values in the feature column and take the average value to obtain the contribution of the feature, and sort according to the importance; The shap value calculation formula is as follows: Among them, the weighting factor represents the possibility of different combinations, and the specific calculation formula is as follows: in, For a feature X k The Shapley value of is the contribution, N represents the set of all feature variables involved, Represents the number of elements in the set in which all feature variables participate. S is a subset of N. is the number of elements in the subset of N, represents the contribution of combination S, Remove feature X from the set k After the collection, To remove feature X k After the contribution, For feature X k marginal contribution; Step S8-3: Compare the two sorting analyses to find the key factors affecting shallow gas release, and draw a characteristic density scatter plot and a partial dependence plot according to the shap value.
Citation Information
Patent Citations
System for integrally exploiting marine energy resource
CN101666286A
Method for predicting concentration of dissolved gas in transformer oil based on random forest
CN110428113A
Laboratory simulation method for determining deep sea seabed natural gas hydrate generation efficiency
CN113533676A
Wetland methane emission change research method based on multi-source remote sensing data
CN114067213A
Water body dissolved oxygen concentration prediction system
CN116338819A
Cited By
Method of seabed gas dissipation in-situ monitoring device based on acoustic-optical-electric technology
CN120102530A
Filling body multi-age strength prediction and material inversion model construction method
CN120805410A
Method for predicting core temperature of miner in deep ground high-temperature and high-humidity environment
CN121808580A
Intelligent identification method and system for methane leakage based on multi-dimensional signal fusion of double-layer sensing array
CN122778321A
