Thresholds and interaction extraction method of environmental variables affecting heavy metal content distribution in mining areas

By combining gradient boosting decision trees and SHAP values, the problem of identifying thresholds and interaction effects in soil heavy metal distribution was solved, enabling precise location of key control factors and effective analysis of multi-factor interactions, thus improving the reliability and accuracy of the analysis results.

CN120632663BActive Publication Date: 2025-10-24CENT SOUTH UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511128162.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-13
Publication Date
2025-10-24
Estimated Expiration
2045-08-13

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately identify key control factors, threshold effects, and interactions in soil heavy metal distribution, and geographic detector methods are unable to effectively explore multi-factor interactions, leading to errors in the analysis results.

Method used

The gradient boosted decision tree (GBDT) model was combined with the SHAP value. By calculating the mean square error and SHAP difference value of the split nodes, the threshold and interaction effects of environmental variables were extracted, and the significance was evaluated using the permutation test to construct a multidimensional analysis system.

Benefits of technology

It achieves precise location of key thresholds for heavy metal distribution and effective capture of multi-factor interactions, breaking through the linear limitations of traditional methods and improving the reliability and accuracy of analysis results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120632663B_ABST
    Figure CN120632663B_ABST
Patent Text Reader

Abstract

The application discloses an environmental variable threshold and interaction effect extraction method for influencing heavy metal content distribution in a mining area, and comprises the following steps: obtaining data samples of heavy metal content in the mining area and a plurality of environmental variables which have an influence on the heavy metal content, and training a gradient boosting decision tree; for each environmental variable, the relative importance of the environmental variable to the heavy metal content in all environmental variables is determined by extracting split nodes and calculating the cumulative sum of the mean square error reduction caused by the split nodes; in addition, the maximum value of the average SHAP difference value on both sides of each split node is selected as the threshold of the environmental variable; the global values of the feature main effect, the two-way interaction effect and the three-way interaction effect of the environmental variables are calculated, and then the significant effects are screened out through significance evaluation. The application can accurately locate the key threshold influencing the heavy metal distribution and effectively capture the interaction between environmental variables.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of environmental data analysis, and particularly relates to a method for extracting threshold values and interaction effects of environmental variables affecting the distribution of heavy metal content in mining areas. BACKGROUND

[0002] The chemical behavior of heavy metals in the soil environment is extremely complex, and its spatial distribution and migration are jointly regulated by multiple environmental factors such as parent rock type, soil physical and chemical properties, topography, hydrology, and industrial activities. Accurately identifying the key control factors of soil heavy metal distribution, accurately grasping the threshold effect and interaction of these factors, and delineating high-risk areas are the key breakthroughs for preventing and controlling soil heavy metal pollution in mining areas.

[0003] Threshold effect refers to the phenomenon that the relationship between the independent variable and the dependent variable changes abruptly when the independent variable exceeds a certain value (i.e., the threshold value). Interaction effect means that the relationship between the target variable and one environmental variable can be influenced by other environmental variables. The interaction between environmental factors is complex, and different factors synergistically or antagonistically affect heavy metal distribution. The explanatory power of multi-factor interaction effect is often greater than the sum of two single factors. Currently, there are few studies on environmental factors related to soil heavy metal pollution, and systematic exploration of their threshold effect and interaction is even lacking.

[0004] Correlation analysis, principal component / factor / clustering analysis, one-way / multivariate analysis of variance, and regression analysis (e.g., simple / multiple linear regression, partial least squares regression) are commonly used to identify or quantify the driving factors affecting heavy metal accumulation and distribution. These methods mathematically explain the linear relationship between heavy metals and their potential influencing factors. However, there is a complex nonlinear relationship between heavy metals and environmental factors. In addition to the numerical properties inherent in the data itself, heavy metal data also contains spatial properties that cannot be captured by traditional analysis methods and has spatial dependence, which violates the independent and identically distributed assumption of classical statistical methods. Geographical detector method (GDM) is a method that solves spatial heterogeneity and identifies driving factors by examining the spatial relationship between HMs distribution and influencing factors and quantifying their contributions. This method is good at detecting the relationship between spatial variable type independent variables and numerical type dependent variables, and is an effective method for exploring the interaction effect of two factors on the spatial distribution of heavy metals. However, the geographical detector method can only explore two-factor interaction effects, and cannot consider three-variable or multi-variable interaction effects. Moreover, due to the inability to consider control variables, it may lead to incorrect results.

[0005] Gradient Boosting Decision Tree (GBDT) is a boosting ensemble learning model based on Classification and Regression Tree (CART) algorithm, which has the advantages of loose hypothesis, high goodness of fit, high prediction accuracy, etc. The tree structure characteristics make the threshold judgment and interaction effect analysis naturally integrated into the model construction: the decision tree node splitting is based on the threshold of environmental factors, which can accurately locate the key threshold affecting the distribution of heavy metals; the combination of multiple decision trees and the logical relationship of nodes can effectively capture the synergistic or antagonistic interaction between environmental factors, and intuitively display the complex relationship of multiple factors. In addition, the GBDT model is good at processing high-dimensional nonlinear data, breaking through the limitations of traditional linear models, accurately depicting the complex relationship between environmental factors and heavy metal distribution, and efficiently identifying threshold differences. SUMMARY

[0006] The application provides an environmental variable threshold and interaction effect extraction method for affecting the distribution of heavy metal content in a mining area, which can accurately locate the key threshold affecting the distribution of heavy metals and effectively capture the interaction between environmental variables.

[0007] To achieve the above technical purposes, the application adopts the following technical solutions:

[0008] An environmental variable threshold and interaction effect extraction method for affecting the distribution of heavy metal content in a mining area, comprising:

[0009] Obtaining data samples of heavy metal content in a mining area and several environmental variables affecting the heavy metal content, and training gradient boosting decision trees with the environmental variable values and heavy metal content in the samples as input and output respectively;

[0010] For each environmental variable, extract the split nodes of the environmental variable from each decision tree: on the one hand, calculate the cumulative sum of the mean square error reduction caused by the split nodes to determine their relative importance to the heavy metal content among all environmental variables; on the other hand, calculate the average SHAP difference value on both sides of each split node, and select the maximum value from all average SHAP difference values as the threshold of the environmental variable;

[0011] Calculate the feature main effect, two-way interaction effect and three-way interaction effect of all environmental variables based on each training sample in each decision tree, and then calculate the average value based on all decision trees and all training samples to obtain the global value of the feature main effect, two-way interaction effect and three-way interaction effect;

[0012] Based on the global values of the feature main effect, two-way interaction effect and three-way interaction effect, the significance of the feature main effect of each environmental variable, the two-way interaction effect between each two environmental variables and the three-way interaction effect between each three environmental variables is evaluated to obtain the significant effects.

[0013] Further, the types of the plurality of environmental variables include contents of a plurality of preset components in the soil, a plurality of preselected terrain factors, a plurality of preselected industrial factors, soil types, and land use types.

[0014] Further, a variance inflation factor is used to screen and retain, from all the environmental variables, a part of the environmental variables with a collinearity less than a preset value to construct the data sample.

[0015] Further, the calculation of the accumulative sum of the reduction of the mean square error caused by the split node determines the relative importance of the split node in all the environmental variables, and specifically includes:

[0016] First, the mean square error of the data sample corresponding to the parent node and the two child nodes of the mth split node in each decision tree is calculated.

[0017] ;

[0018] ;

[0019] In the formula, and are the environmental variables corresponding to the parent node and the arbitrary child node of the nth split node in the decision tree, respectively. and respectively represent the data sample set corresponding to the parent node and the arbitrary child node of the nth split node in the decision tree, respectively. and are the heavy metal content of the data sample and the predicted value of the current decision tree, respectively. and are the number of data samples corresponding to the parent node and the arbitrary child node of the nth split node in the decision tree, respectively.

[0020] Then, the accumulative sum of the reduction of the mean square error caused by all the split nodes in the decision tree is calculated. :

[0021] ;

[0022] In the formula, and are the environmental variables corresponding to the parent node and the arbitrary child node of the nth split node in the decision tree, ​​The two child nodes of the split node correspond to the mean square error of the data samples;

[0023] Finally, based on the environment variables The sum of the mean square error reduction caused by all split nodes in each decision tree is accumulated, and the environmental variables are calculated by combining all decision trees Relative importance among all environmental variables :

[0024] ;

[0025] Where, For environment variables In the The cumulative sum of the mean square error reduction caused by all split nodes in the decision tree, is the number of decision trees, is the number of environment variables in the data sample.

[0026] Furthermore, when the environment variable In the The first decision tree When it is used as a split node, focus on the training samples included in the parent node of the split node, that is, the parent node sample set , calculate the average SHAP difference value on both sides of the splitting threshold , the calculation formula is:

[0027] ;

[0028] Where, For environment variables In the The first decision tree The split value when it is used as a split node is determined by The training process of a decision tree is based on the parent node sample set Optimized; and Represents the parent node sample set Satisfy and The number of training samples, The parent node sample set No. Environmental variables in training samples The numerical value of For the Environmental variables in training samples In the SHAP contribution value of heavy metal content prediction in each decision tree, reflecting environmental variables In the the individual influence of each decision tree on the prediction result of the i-th training sample;

[0029] Then, the maximum value is selected from the average SHAP difference values corresponding to all split nodes of the environmental variable as the final threshold value of the environmental variable , denoted as:

[0030] ;

[0031] In the formula, represents the final threshold value of the environmental variable extracted by the threshold effect analysis, represents the absolute value. Further, the contribution of the environmental variable in the i-th training sample to each decision tree is calculated as:

[0032]

[0033] ;

[0034] In the formula, represents the set of all environmental variables; represents the set obtained by removing the environmental variable from the set ; represents all subsets with value ; and respectively represent the number of environmental variables in the set and ; The conditional expectation prediction of the decision tree model for the training sample only using the environmental variable set ; represents the conditional expectation prediction of the decision tree model for the training sample only using the environmental variable set . Further, the environmental variable is calculated based on the feature main effect, two-way interaction effect and three-way interaction effect of each training sample in each decision tree, and the calculation formula is:

[0035]

[0036] ;

[0037] ;

[0038] ; ​​​​​​​​​

[0039] where, is an environmental variable based on the training samples of the feature main effect, is two environmental variables based on the training samples of the two-way interaction effect, is three environmental variables based on the training samples of the three-way interaction effect; denotes the set of all environmental variables, denotes the set after removing the environmental variable , the set obtained, all subsets with values , and and denote the number of environmental variables in the set and , respectively. denotes the conditional expectation prediction of the decision tree model on the training samples using only the environmental variable set W; the environmental variable set .

[0040] Further, the feature main effect, two-way interaction effect and three-way interaction effect on a single training sample are calculated first, and then the effect values of all training samples are averaged to obtain the average effect strength of a single, two, three environmental variables on the global sample, quantifying the general influence of environmental variable combination on heavy metal content prediction, and the calculation formula is as follows:

[0041] ;

[0042] ;

[0043] ;

[0044] where, is an environmental variable the average main effect of all samples, is two environmental variables the average two-way interaction effect of all samples, is three environmental variables the average three-way interaction effect of all samples; denotes the total number of samples; denotes the set of all environmental variables, denotes the set after removing the environmental variable , the set obtained, all subsets of , and respectively represent the number of environmental variables in the set and , represents the conditional expectation prediction of the decision tree model for the training sample when only using the environmental variable set W; the environmental variable set .

[0045] Further, the average value is calculated based on all decision trees and all training samples to obtain the global value, which is specifically represented as:

[0046] , , ;

[0047] In the formula, is the global value of the main effect of the environmental variable , is the global value of the two-way interaction effect of the environmental variable , respectively are the global values of the three-way interaction effect of the environmental variable .

[0048] Further, the significance of each feature main effect, two-way interaction effect and three-way interaction effect is evaluated by the permutation test.

[0049] Compared with the prior art, the application has the following beneficial effects:

[0050] 1. The GBDT model is combined with the SHAP (SHapley Additive exPlanations) game theory framework to construct a multi-dimensional analysis system of "feature importance-threshold effect-interaction effect", which breaks through the limitation of traditional linear models that cannot capture the nonlinear relationship between environmental variables and heavy metal content.

[0051] 2. The decision tree split point is combined with the SHAP value to realize automatic identification of the threshold effect of environmental variables on heavy metal content, solving the subjective problem of pre-setting threshold in traditional methods.

[0052] 3. The two-way, three-way and other high-order interaction effect calculation formula based on the SHAP value logic realizes the quantitative analysis of the combined influence of multiple environmental variables (such as pH, SOM and DEM) on heavy metal content, filling the technical gap of multi-factor interaction analysis in the field of spatial differentiation of soil heavy metals.

[0053] 4. The main effect and interaction effect are evaluated for significance by a permutation test, which improves the reliability of the analysis results and overcomes the ambiguity in effect significance judgment in the prior art. BRIEF DESCRIPTION OF DRAWINGS

[0054] Figure 1 is a flowchart of the environmental variable threshold value and interaction effect extraction method described in the embodiments of the present application.

[0055] Figure 2 is the relative importance of the environmental variable to the change in the content of heavy metal Tl (thallium) in the embodiments of the present application.

[0056] Figure 3 is the threshold effect of the environmental variable TK on the change in the content of Tl in the embodiments of the present application.

[0057] Figure 4 is the interaction effect of the environmental variable TK and SPI on the change in the content of Tl in the embodiments of the present application.

[0058] Figure 5 is the three-way interaction effect of the environmental variables TK, SPI and DEM on the change in the content of Tl in the embodiments of the present application. DETAILED DESCRIPTION

[0059] The embodiments of the present application are described in detail below. The embodiments are based on the technical solutions of the present application and give detailed implementation modes and specific operation processes, which further explain and describe the technical solutions of the present application.

[0060] The embodiments provide an environmental variable threshold value and interaction effect extraction method for affecting the distribution of heavy metal content in a mining area, as shown in Figure 1 , which includes the following steps:

[0061] Step 1: Obtain data samples of heavy metal content in a mining area and several environmental variables that affect the heavy metal content, and use the environmental variable values and heavy metal content in the samples as input and output to train a gradient boosting decision tree.

[0062] The embodiments of the present application are explained and described by taking thallium as an example.

[0063] First, select environmental variables.

[0064] Soil factors commonly regulate the distribution and risk of thallium through adsorption-desorption equilibrium, ion competition, complexation-precipitation and parent material source. Topographic factors commonly indirectly affect the spatial differentiation of soil thallium through regulating the erosion-deposition process, water condition and oxidation-reduction state. Industrial factors are important output points of thallium elements to the environment. Agricultural factors reflect the influence of agricultural activities on soil thallium. Therefore, 22 environmental variables that may affect the enrichment of thallium in soil in non-ferrous metal mining areas are selected from the four aspects in this embodiment, including (i) soil factors: pH, SOM, CEC, Al2O3, SiO2, TFe2O3, MgO, CaO, Na2O, K2O, TiO2 and soil type (ST); (ii) topographic factors: elevation (DEM), slope (Slope), topographic wetness index (TWI) and stream power index (SPI); (iii) industrial factors: heavy metal related enterprise density (HE), river density (DRiver) and road density (DRoad); (iiii) agricultural factors: TN, TP and land use type (LU).

[0065] Then, the thallium content of the soil sample and the value of each environmental variable are calculated by sampling and analysis.

[0066] According to the distribution of rivers, highways, soil types and mining point locations in the study area, the sampling points are designed according to the sampling density of linear distance interval of about 0.5 km, and multiple soil samples are collected by using 5-point sampling method. The Tl element content, pH value, organic matter content (SOM), cation exchange capacity (CEC), total nitrogen content (TN), total phosphorus content (TP) and major element content (Al2O3, SiO2, TFe2O3, MgO, CaO, Na2O, K2O, TiO2) of each sample are obtained.

[0067] Among them, pH, SOM, CEC, Al2O3, SiO2, TFe2O3, MgO, CaO, Na2O, K2O, TiO2, TN and TP are obtained by measuring soil samples; ST and LU data come from the Resource and Environmental Science and Data Center; DEM data come from ASTER GDEM data set, and Slope, TWI and SPI are obtained by processing DEM data by ArcGIS software; HE is obtained by calculating the kernel density of heavy metal related enterprise data released by the ecological environment office; DRoad and DRiver are obtained by calculating the line density of road and river data provided by the Resource and Environmental Science and Data Center. The measurement or calculation method of thallium content and each environmental variable in this embodiment is obtained by using the prior art.

[0068] Then, the environmental variable data is preprocessed.

[0069] To visualize the interactions between environmental variables, the two environmental variables, land use (LU) and soil type (ST), were classified by LabelEncoder. In addition, the variance inflation factor (VIF) was used to filter the environmental variables with less than a pre-set value of collinearity from all environmental variables to build the data samples for the gradient boosting decision tree (GBDT) model.

[0070] Finally, the gradient boosting decision tree (GBDT) model was built and trained.

[0071] The gradient boosting decision tree (GBDT) model was built with the filtered environmental variable data as input and thallium content as output. During the training of the GBDT model, the original data sample set was divided into a training set and a test set (8:2), and the random parameter search cross-validation was used to optimize the parameters. The GBDT model was built using Python language, and the optimal hyperparameter combination was: learning_rate, 0.005; max_depth, 5; n_estimators, 800; Huber loss function was used to handle outliers. 5-fold cross-validation was used to check the fitting accuracy of the model, and the coefficient of determination (R2), root mean square error (RMSE), and mean absolute error (MAE) were used to evaluate the model performance.

[0072] Step 2, for each environmental variable, extract the split nodes for that environmental variable from each decision tree: on the one hand, calculate the cumulative sum of the reduction in mean square error caused by the split node to determine its relative importance among all environmental variables; on the other hand, calculate the average SHAP difference value on both sides of each split node, and select the maximum value from all average SHAP difference values as the threshold value for that environmental variable.

[0073] In the trained decision tree, the split value (i.e. threshold) of each split node is determined by finding the optimal split point during the model training process, with the goal of making the split data set as pure as possible. These split values can be obtained through the model's properties or methods for analyzing and interpreting the behavior of the decision tree.

[0074] wherein the calculation of the cumulative sum of the reduction in mean square error caused by the split node to determine its relative importance among all environmental variables specifically includes:

[0075] First, calculate the environmental variable The mean square error of the data samples corresponding to the mth split node and its two child nodes in each decision tree is:

[0076] ;

[0077] ;

[0078] are environmental variables are environmental variables are environmental variables are the root node and any child node of the i-th split node in the decision tree, respectively, and include data samples are the root node and any child node of the i-th split node in the decision tree, respectively, and include data samples are environmental variables are the root node and any child node of the i-th split node in the decision tree, respectively, and include data samples are the root node and any child node of the i-th split node in the decision tree, respectively, and include data samples are the root node and any child node of the i-th split node in the decision tree, respectively, and include data samples are the heavy metal content of the data sample and the predicted value of the current decision tree, respectively are the root node and any child node of the i-th split node in the decision tree, respectively, and include data samples are the root node and any child node of the i-th split node in the decision tree, respectively, and include data samples are environmental variables are the root node and any child node of the i-th split node in the decision tree, respectively, and include data samples are the root node and any child node of the i-th split node in the decision tree, respectively, and include data samples

[0079] Then, the cumulative sum of the reduction in the mean square error caused by all the split nodes in the decision tree is calculated :

[0080] ;

[0081] are environmental variables are the root node and any child node of the i-th split node in the decision tree, respectively, and include data samples are the root node and any child node of the i-th split node in the decision tree, respectively, and include data samples are the root node and any child node of the i-th split node in the decision tree, respectively, and include data samples are the root node and any child node of the i-th split node in the decision tree, respectively, and include data samples

[0082] Finally, the cumulative sum of the reduction in the mean square error caused by all the split nodes in each decision tree is calculated based on the environmental variables , and the relative importance of the environmental variables in all environmental variables is calculated by integrating all decision trees :

[0083] ;

[0084] are environmental variables is the cumulative sum of the reduction in the mean square error caused by all the split nodes in the i-th decision tree, is the number of decision trees, is the number of environmental variables in the data sample.

[0085] ​​​The embodiment utilizes the trained gradient boosting decision tree to obtain the relative importance value of the contribution of the environmental variables to the change of the heavy metal content, so that the contribution degree ranking and distribution characteristics of the environmental variables to the heavy metal content can be further displayed through the Swarm chart and the feature importance bar chart to identify the main control factors of thallium element migration and transformation in non-ferrous metal mining areas and the influence intensity.

[0086] Further, when the environmental variable In the first decision tree, the training sample set included in the parent node of the split node is focused, i.e., the parent node sample set , the average SHAP difference value on both sides of the split threshold is calculated, i.e., the marginal effect of the threshold at the split node on the prediction of the heavy metal content, and the calculation formula is:

[0087] ;

[0088] In the formula, is the split value when the environmental variable is the split node in the first decision tree, which is obtained by optimizing the parent node sample set in the training process of the first decision tree; and respectively represent the number of training samples in the parent node sample set that satisfy and respectively, is the value of the environmental variable in the first training sample in the parent node sample set ; is the SHAP contribution value of the environmental variable in the first training sample to the prediction of the heavy metal content in the first decision tree, which reflects the individual influence of the environmental variable in the first decision tree on the prediction result of the first training sample.

[0089] In the formula, the contribution of the environmental variable in the first training sample to each decision tree is calculated, and the calculation formula is:

[0090] ;

[0091] In the formula,​​​ denotes a set of all environmental variables; denotes a set removing environmental variables obtained set; denotes all subsets of , where S is a subset of the set of environmental variable characteristics actually included in the sample p (i.e. only considering the feature combination existing in the sample p when analyzing the sample p); and denote the number of environmental variables in the sets and respectively; the conditional expectation prediction of the decision tree model on the training sample using only the environmental variable set (fixed environmental variable of the sample p limited to the subset S when predicting); denotes the conditional expectation prediction of the decision tree model on the training sample using only the environmental variable set .

[0092] Then, from the average SHAP difference values corresponding to all split nodes of the environmental variable , the maximum value is selected as the final threshold value of the environmental variable, which is expressed as:

[0093] ;

[0094] wherein, denotes the final threshold value of the environmental variable extracted by the threshold effect analysis, denotes the absolute value.

[0095] By using the trained GBDT model, the partial dependence plot between the heavy metal content (thallium is taken as an example in the embodiment) and each environmental variable can be drawn, and the nonlinear relationship between the continuous environmental variable and the heavy metal content change can be obtained by combining the extracted final threshold value, so that the threshold effect of the environmental variable on the heavy metal content (i.e. the direction or intensity of the influence on the thallium content changes suddenly when the variable exceeds a certain critical value) can be naturally captured.

[0096] Step 3, calculate the feature main effect, two-way interaction effect and three-way interaction effect of all environmental variables based on each training sample for each decision tree, and then calculate the average value based on all decision trees and all training samples to obtain the global value of the feature main effect, two-way interaction effect and three-way interaction effect.

[0097] ​The embodiment utilizes the trained GBDT model to calculate the variance contribution value of two-way and three-way interaction between environmental variables to the change of Tl content, so as to draw two-way and three-way interaction diagrams to explore the synergistic or antagonistic effect and influence intensity of Tl element in non-ferrous metal mining area under the interaction of environmental variables.

[0098] wherein, the environmental variables are calculated based on the feature main effect, two-way interaction effect and three-way interaction effect of each training sample in each decision tree, and the calculation formula is:

[0099] ;

[0100] ;

[0101] ;

[0102] In the formula, is the environmental variable based on the feature main effect of the training sample , is the two-way interaction effect of two environmental variables based on the training sample , is the three-way interaction effect of three environmental variables based on the training sample ; represents the set of all environmental variables, represents the set after removing the environmental variable , all subsets with the value , and respectively represent the number of environmental variables in the set and , represents the conditional expectation prediction of the decision tree model to the training sample only using the environmental variable set W; the environmental variable set .

[0103] wherein, the two-way interaction effect of any environmental variable can be calculated by using the simplified , wherein, represents the contribution of the joint action of the environmental variables .

[0104] Then, the average value is calculated based on all decision trees and all training samples to obtain the global value, which is specifically represented as:

[0105] , , ;

[0106] wherein, is an environmental variable a global value of main effect, is an environmental variable a global value of two-way interaction effect, is an environmental variable a global value of three-way interaction effect.

[0107] The characteristic main effect, two-way interaction effect and three-way interaction effect of the present application are integrated into model explanation through the additive decomposition framework of SHAP, and the fairness is ensured by separating the net contribution and Shapley value weighting with conditional expectation difference, so that the precise quantification of the synergistic effect of two or three environmental variables is realized. Therefore, the present application quantifies the synergistic contribution of multiple environmental variable characteristics with Shapley logic, so that the disassembly of the decision tree model prediction is more complete and more in line with the interactive mode of real data.

[0108] Step 4, based on the global values of the main effect, two-way interaction effect and three-way interaction effect of each characteristic, the main effect of each environmental variable, the two-way interaction effect between each two environmental variables and the three-way interaction effect between each three environmental variables are evaluated for significance, and the significant effects are screened out.

[0109] In this embodiment, the main effect, two-way interaction effect and three-way interaction effect of each characteristic are evaluated for significance by permutation test. In each significance evaluation, the values of a certain environmental variable in the training sample are randomly shuffled, the corresponding effect value is recalculated, the p value is calculated based on the permutation distribution, and the main effect, two-way interaction effect and two-way interaction effect with significant are screened out based on the preset significant effect threshold.

[0110] Further, a honeycomb chart ( Figure 2 ), an interaction effect heat map ( Figure 4 ) and a three-dimensional surface chart ( Figure 5 ) can be drawn to show the main effect and interaction effect strength and direction of each environmental variable; a partial dependence chart ( Figure 3 ) can be generated to show the marginal relationship between the feature and its interaction and the Tl content.

[0111] Figure 2 The relative importance of multiple environmental variables on the change of Tl content is shown.

[0112] Figure 3 The threshold effect of environmental variable TK on the change of Tl content is shown.

[0113] Figure 4The two-way interaction effect of environmental variable TK and SPI on the change of Tl content is shown.

[0114] Figure 5 The three-way interaction effect of environmental variables TK, SPI and DEM on the change of Tl content is shown.

[0115] The above embodiments are the preferred embodiments of the present application, and those skilled in the art can make various modifications or improvements on the basis of the above embodiments without departing from the general concept of the present application, and these modifications or improvements should also belong to the scope of protection of the present application.

Claims

1. A method for extracting threshold values and interaction effects of environmental variables affecting the distribution of heavy metal content in a mining area, characterized by, The method comprises the following steps: obtaining data samples of heavy metal content in a mining area and several environmental variables affecting the heavy metal content, and training gradient boosting decision trees with the environmental variable values and the heavy metal content in the samples as input and output respectively; for each environmental variable, extracting split nodes for the environmental variable from each decision tree: on the one hand, calculating the cumulative sum of the reduction of mean square error caused by the split nodes to determine the relative importance of the split nodes in all environmental variables to the heavy metal content; on the other hand, calculating the average SHAP difference value on both sides of each split node, and selecting the maximum value from all average SHAP difference values as the threshold value of the environmental variable; calculating the feature main effect, two-way interaction effect and three-way interaction effect of all environmental variables based on each training sample in each decision tree, and then calculating the average value based on all decision trees and all training samples to obtain the global value of the feature main effect, two-way interaction effect and three-way interaction effect; wherein the feature main effect, two-way interaction effect and three-way interaction effect of all environmental variables based on each training sample in each decision tree are calculated according to the following formula: ; ; ; wherein, is an environmental variable is an environmental variable is the main effect of a feature based on the training sample is an environmental variable is the two-way interaction effect based on the training sample is an environmental variable is an environmental variable is the three-way interaction effect based on the training sample is an environmental variable denotes the set of all environmental variables, denotes the set denotes the set obtained by removing the environmental variable denotes all subsets of with values and denote the number of environmental variables in the sets and respectively, denotes the conditional expectation prediction of the decision tree model for the training sample using only the environmental variable set W; environment variable set ; based on the global values of the feature main effect, two-way interaction effect and three-way interaction effect, performing significance evaluation on the feature main effect of each environmental variable, the two-way interaction effect between each two environmental variables and the three-way interaction effect between each three environmental variables to obtain significant effects.

2. The method for extracting threshold values and interaction effects of environmental variables affecting the distribution of heavy metal content in mining areas according to claim 1, characterized by, The types of the several environmental variables include: the contents of a plurality of preset components in the soil, a plurality of preselected terrain factors, a plurality of preselected industrial factors, soil types and land use types.

3. The method for extracting threshold values and interaction effects of environmental variables affecting the distribution of heavy metal content in mining areas according to claim 2, characterized by, A variance inflation factor is used to screen and retain part of the environmental variables with collinearity less than a preset value from all environmental variables to construct the data samples.

4. The environmental variable threshold and interaction effect extraction method of affecting the distribution of heavy metal content in a mining area according to claim 1, characterized in that, The calculation of the cumulative sum of the reduction of mean square error caused by the split nodes to determine the relative importance of the split nodes in all environmental variables comprises: First, compute the environment variable The mean squared error of the data samples corresponding to the parent and two children of the mth split node in each decision tree is included: ; ; Where, and Respectively, environment variables In the decision tree The root mean square error of the data samples corresponding to the parent node and any child node of the split node; and Represents environment variables respectively In the decision tree The data sample set included in the parent node and any child node of the split node, and are the heavy metal content of the data sample and the predicted value of the current decision tree respectively; and Respectively, environment variables In the decision tree The number of data samples included in the parent node and any child node of the split node; Then, the environmental variables are counted The cumulative sum of the reduction in mean squared error caused by all the splits in the decision tree as a node : ; wherein and are environmental variables The two child nodes of a split node in a decision tree correspond to the mean squared error including data samples as a split node. Finally, the environmental variables are based on The cumulative sum of the reduction in mean squared error caused by each split node in each decision tree is accumulated and the environmental variables are computed by combining all decision trees The relative importance of all environmental variables : ; wherein is the environmental variable In the first is the cumulative sum of the reduction in mean squared error caused by all splits in the decision tree, is the number of decision trees, is the number of environmental variables in the data sample.

5. The method for extracting threshold values and interaction effects of environmental variables affecting the distribution of heavy metal content in mining areas according to claim 1, characterized by, When the environment variable In the first In the decision tree, the first When the split node is the second time, focus on the training samples included in the parent node of the split node, that is, the parent node sample set , Calculate the average SHAP difference value on both sides of the split threshold , The formula is: ; In the formula, is an environmental variable In the first In the first Split value when the first The first Optimized by the decision tree training process for the parent node sample set and Respectively represent the number of training samples in the parent node sample set Respectively satisfy and , respectively is the value of the environmental variable The first The first The first The first The first SHAP contribution value of the environmental variable In the first In the first The first The individual influence of the environmental variable Then the maximum value of the average SHAP difference values of all split nodes of the environmental variable is selected as the final threshold value of the environmental variable , which is expressed as:​ ; wherein represents an environmental variable the final threshold value extracted in the threshold effect analysis, represents the absolute value of the absolute value of 6. The method for extracting threshold values and interaction effects of environmental variables affecting the distribution of heavy metal content in mining areas according to claim 5, characterized by, The first environmental variables in each training sample contribution of each decision tree The calculation formula is: ; where denotes the set of all environment variables; denotes the set of environment variables removed; denotes all subsets of with values and denote the number of environment variables in the sets and respectively; denotes the conditional expectation prediction of the decision tree model on the training sample using only the set of environment variables ; and denotes the conditional expectation prediction of the decision tree model on the training sample using only the set of environment variables .

7. The method for extracting threshold values and interaction effects of environmental variables affecting the distribution of heavy metal content in mining areas according to claim 1, characterized by, first, calculating the feature main effect, two-way interaction effect and three-way interaction effect on a single training sample, and then averaging the effect values of all training samples to obtain the average effect intensity of a single, two and three environmental variables on the global samples, which quantifies the general influence of the combination of environmental variables on the prediction of the heavy metal content, and the calculation formula is as follows: ; ; ; where is the environmental variable is the average main effect on all samples is the two-way interaction effect on all samples is the average two-way interaction effect on all samples is the three-way interaction effect on all samples is the average three-way interaction effect on all samples denotes the total number of samples denotes the set of all environmental variables denotes the set removes the environmental variable results in the set takes the value all subsets of and denote the number of environmental variables in the sets and respectively denotes the conditional expectation prediction of the decision tree model on the training samples using only the environmental variable set W environment variable set .

8. The method for extracting threshold values and interaction effects of environmental variables affecting the distribution of heavy metal content in mining areas according to claim 1, characterized by, the average value based on all decision trees and all training samples is calculated to obtain the global value, which is specifically represented as: , , ; wherein is an environmental variable global value of the main effect, is an environmental variable global value of the two-way interaction effect, are environmental variables global value of the three-way interaction effect.

9. The method for extracting threshold values and interaction effects of environmental variables affecting the distribution of heavy metal content in mining areas according to claim 1, characterized by, The significance of the feature main effect, two-way interaction effect and three-way interaction effect is evaluated by permutation test.

Citation Information

Patent Citations

  • Method suitable for non-contact measurement of power consumption of electric equipment

    CN115267320A

  • Soil heavy metal pollution driving factor identification method based on Catboost-SHAP model

    CN117290727A