Causal inference method and system for complex deviation of mixing and collision

By using the joint training of the decoupled representation generator and the processing variable estimator in causal inference, decoupled representation and conditional shadow variables are generated, the causal inference problem in complex deviation scenarios is solved, and the unbiased causal effect estimation is achieved, improving The accuracy of causal inference.

CN119204218AInactive Publication Date: 2024-12-27ZHEJIANG UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411269745.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-12-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art cannot effectively perform causal inference in complex deviation scenarios, especially when facing complex scenarios where multiple deviations exist simultaneously, it is impossible to achieve unbiased causal effect estimation.

Method used

Using a causal inference method for confounding and collision complex deviations, decoupled characterization is generated by obtaining population characteristic information, intervening on population, and group behavior categories as result variables, and using a joint training of decoupled characterization generator and processing variable estimator and conditional shadow variables, remove complex deviations and achieve unbiased causal effect estimation.

Benefits of technology

The unbiased causal effect estimation in complex deviation scenarios is realized, and confusion deviation and selection deviation can be eliminated at the same time, improving the accuracy of causal inference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119204218A_ABST
    Figure CN119204218A_ABST
Patent Text Reader

Abstract

The invention discloses a causal inference method and a causal inference system for complex deviations of mixing and collision. The causal inference method comprises the following steps: acquiring and marking crowd characteristics and behavior data; jointly training the decoupling representation generator and the processing variable estimator, respectively training the decoupling representation generator, the processing variable estimator, the R1 estimator, the R0 estimator and the first result variable estimator, and then training the second result variable estimator; and finally, inputting the crowd characteristics and behavior data which want to perform causal effect estimation into a causal effect estimation model, and predicting crowd behavior changes caused by applying intervention and not applying intervention. Compared with a traditional tool variable regression method only capable of removing confusion deviation, the method has the advantages that selection deviation and confusion deviation possibly existing in a real complex scene at the same time are fully considered, and causal effect unbiased estimation in the complex deviation scene is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of causal inference, and in particular relates to a causal inference method and system for complex deviations of mixing and collision. Background Art

[0002] Causal inference is a powerful explanatory tool that plays an important role in decision-making in many different fields, such as precision medicine, policy decisions, precision recommendations, and teaching strategy improvements. In order to identify conditional causal effects, that is, heterogeneous causal effects in different populations, a gold standard in the causal field is randomized controlled experiments, but because of the huge time-consuming and costly and ethical issues involved. We can often only perform causal analysis based on observational data. However, in the common case of complex biases in the observational data set, we can only observe some covariates and the outcome variable values ​​of some samples. Only using these observed covariates and subsamples of observed outcome variable values ​​to infer causal effects often results in biased results.

[0003] However, traditional causal inference methods, such as the instrumental variable method used to address the confounding bias caused by unobserved covariates and the shadow variable method used to address the selection bias caused by unobserved values ​​of some outcome variables, can often only solve simple scenarios with a single bias and are not applicable when faced with complex scenarios where multiple biases exist simultaneously. Summary of the invention

[0004] The purpose of the present invention is to solve the problem of causal inference in complex deviation scenarios to which the prior art is not applicable, and to provide a causal inference method and system for mixed and colliding complex deviations.

[0005] In order to achieve the above-mentioned invention object, the present invention specifically adopts the following technical solutions:

[0006] In a first aspect, the present invention provides a causal inference method for mixed and colliding complex deviations, comprising the following steps:

[0007] S1. Obtaining population characteristics and behavior data with population characteristics information as covariates, interventions imposed on the population as treatment variables, population behavior categories as outcome variables, and instrumental variables predefined according to expert knowledge, and dividing the population characteristics and behavior data into selected sample data and non-selected sample data according to whether the outcome variables can be observed, marking the two parts of data for sample selection, constructing a selected data set using the marked selected sample data, and constructing a non-selected data set using the marked non-selected sample data;

[0008] S2, jointly training a decoupled representation generator and a processing variable estimator on the selected data set and the unselected data set, during the joint training, regressing and estimating the sample selection mark by the sample selection mark estimator, and constraining the decoupled representation generated by the decoupled representation generator to satisfy the conditional independence assumption through the integral probability metric, so as to optimize the generated decoupled representation, and obtaining the estimated value of the processing variable after regressing and estimating the processing variable by the processing variable estimator, calculating the residual between the true value of the processing variable and the estimated value of the processing variable and using it as the conditional shadow variable of the selected data set;

[0009] S3, the result variable is regressed by the conditional shadow variable and the covariate, treatment variable and decoupling representation training first result variable estimator of the selected data set; the conditional shadow variable of the selected data set is regressed by the covariate, treatment variable and decoupling representation training R1 estimator; the conditional shadow variable of the unselected data set is regressed by the covariate, treatment variable and decoupling representation training R0 estimator; the sample selection probability is regressed by the covariate, treatment variable, conditional shadow variable and decoupling representation training sample selection probability estimator of the selected and unselected data sets;

[0010] S4, using the trained decoupled representation generator, the treatment variable estimator, the R1 estimator, the R0 estimator and the first result variable estimator to calculate the second result variable of the selected data set; training the second result variable estimator with the covariate, the treatment variable and the decoupled representation of the selected data set to perform regression estimation on the second result variable;

[0011] S5. The trained decoupled representation generator, treatment variable estimator, first outcome variable estimator, second outcome variable estimator and sample selection probability estimator are combined to form a causal effect estimation model. The characteristics and behavior data of the population for which causal effect estimation is desired are input into the causal effect estimation model to predict the changes in population behavior brought about by intervention versus no intervention.

[0012] Based on the above scheme, each step can be implemented in the following preferred specific manner.

[0013] As a preferred embodiment of the first aspect, the population characteristics and behavior data use basic information of women and their families as covariates, women receiving seven years or more of education as treatment variables, whether women were born in the first half of the year as instrumental variables, and the number of living children in the family as outcome variables, and the prediction results output by the causal effect estimation model are specifically the change in the number of living children in the family brought about by women receiving seven years or more of education compared with women not receiving seven years or more of education;

[0014] In the product recommendation scenario, the population characteristics and behavior data use user and product store information as covariates, whether the product is recommended to the user as a treatment variable, the advertising channel as an instrumental variable, and whether the user purchases the product as an outcome variable. The prediction result output by the causal effect estimation model is specifically the change in product transaction volume caused by recommendation versus non-recommendation.

[0015] In the commodity pricing scenario, the population characteristics and behavior data use the basic information of customers and commodities as covariates, commodity prices as treatment variables, economic levels as instrumental variables, and commodity sales volume as outcome variables. The prediction results output by the causal effect estimation model are specifically the changes in commodity sales volume brought about by changes in commodity prices.

[0016] As a preferred embodiment of the first aspect, in step S2, the decoupled representation generator f Φ and the treatment variable estimator f t The specific training process is as follows:

[0017] S21. Using decoupled representation generator f Φ Map the instrumental variables Z in the selected and unselected datasets to a representation space to generate a decoupled representation

[0018] S22. Decouple the generated selected data set and the unselected data set The treatment variable T and covariate X are input to the sample selection marker estimator f s In the sample selection marker estimation,

[0019] S23, input the instrumental variables Z and covariates X of the selected and unselected data sets into the treatment variable estimator f t , and obtain the estimated value of the treatment variable

[0020] S24. Calculate the true value T and estimated value of the treatment variable in the selected data set The residual R between them is used as the conditional shadow variable selected into the data set;

[0021] S25. Calculate sample selection marker estimate The cross entropy between the sample selection marker S and the sample selection marker S is used as the first loss function, and the sample selection marker estimator f is minimized by minimizing the first loss function. s Update the parameters of

[0022] S26, when the processing variable takes a value of 1, it is used as the processing group, and when the processing variable takes a value of 0, it is used as the control group, and the integral probability metric value between the decoupled representation of the processing group and the decoupled representation of the control group is calculated, and the integral probability metric value between the decoupled representation of the processing group and the decoupled representation of the control group is added to the first loss function as the second loss function, and the decoupled representation generator f is minimized by minimizing the second loss function. Φ Update the parameters of

[0023] S27. Calculate the true value T of the treatment variable and the estimated value of the treatment variable The mean square error between them is used as the third loss function, and the processing variable estimator f is processed by minimizing the third loss function. t Update the parameters of

[0024] S28, continue iterating training until the decoupled representation generator f Φ , sample selection marker estimator f s and the treatment variable estimator f t The loss functions of all converge, and the trained decoupled representation generator f is obtained. Φ , sample selection marker estimator f s and the treatment variable estimator f t .

[0025] Furthermore, the first loss function The functional form is:

[0026]

[0027] Where n represents the total number of samples in the selected and unselected datasets; s i ,x i ,t i ,z i They represent the sample selection marker, covariate, treatment variable and instrumental variable of the i-th sample respectively.

[0028] Furthermore, the second loss function The functional form is:

[0029]

[0030] Among them, λ is an adjustable hyperparameter; IPM represents the integrated probability measure.

[0031] Furthermore, the integral probability metric adopts the maximum mean difference function MMD, and its function form is as follows:

[0032]

[0033] Among them, z i ,z j Represent the instrumental variables of the i-th and j-th samples respectively; i:ti =1 indicates the i-th sample in the treatment group, j:t j =0 represents the jth sample of the control group; m1 represents the total number of samples of the treatment group that are not selected into the data set and the selected data set; m0 represents the total number of samples of the control group that are not selected into the data set and the selected data set; k is the kernel function; ||·||2 is the L2 norm.

[0034] Furthermore, the third loss function The functional form is:

[0035]

[0036] As a preferred embodiment of the first aspect, in step S3, the first outcome variable estimator R0 Estimator R1 Estimator and the sample selection probability estimator f p The specific training process is as follows:

[0037] S31, select the conditional shadow variable R, covariate X, treatment variable T and decoupling representation into the data set Input to the first outcome variable estimator The estimated value of the first outcome variable is obtained

[0038] S32, select the covariate X, treatment variable T and decoupling representation into the data set Enter the R1 estimator together In the above example, the conditional shadow variable R of the selected data set is regressed to obtain the estimated value of the first conditional shadow variable.

[0039] S33, decouple the covariate X, treatment variable T and Together we input the R0 estimator f r0 In the above example, the conditional shadow variable R that is not included in the data set is regressed to obtain the estimated value of the second conditional shadow variable.

[0040] S34, the covariate X, treatment variable T, conditional shadow variable R and decoupling representation of the selected and unselected data sets Input to the sample selection probability estimator f p The sample selection probability estimate is obtained

[0041] S35. Calculate the estimated value of the first outcome variable The mean square error between the result variable Y and the result variable Y is used as the fourth loss function, and the first result variable estimator is minimized by minimizing the fourth loss function. Update the parameters of

[0042] S36. Calculate the estimated value of the first conditional shadow variable The mean square error between the conditional shadow variable R and the conditional shadow variable R is used as the fifth loss function, and the R1 estimator is minimized by minimizing the fifth loss function. Update the parameters of

[0043] S37. Calculate the estimated value of the second conditional shadow variable The mean square error between the conditional shadow variable R and the conditional shadow variable R is used as the sixth loss function, and the R0 estimator is minimized by minimizing the sixth loss function. Update the parameters of

[0044] S38. Calculate the sample selection label predicted by the sample selection probability estimate The cross entropy between the sample selection label S is used as the seventh loss function, and the seventh loss function is minimized. Select the probability estimator f for the sample p Update the parameters of

[0045] S39, continue iterating training until the first outcome variable estimator R0 Estimator R1 Estimator and the sample selection probability estimator f p The loss functions of all converge, and the trained first outcome variable estimator is obtained. R0 Estimator R1 Estimator and the sample selection probability estimator f p .

[0046] Furthermore, the fourth loss function The functional form is:

[0047]

[0048] Among them, y i ,r i They represent the outcome variable and conditional shadow variable values ​​of the i-th sample respectively, and n1 represents the total number of samples selected into the data set.

[0049] Furthermore, the fifth loss function The functional form is:

[0050]

[0051] Furthermore, the sixth loss function The functional form is:

[0052]

[0053] Among them, n0 represents the total number of samples not selected into the data set.

[0054] Furthermore, the seventh loss function The functional form is:

[0055]

[0056] Furthermore, the sample selection label The prediction process is as follows:

[0057]

[0058] Among them, α represents the preset hyperparameter threshold.

[0059] As a preferred embodiment of the first aspect, in step S4, the second outcome variable estimator The specific training process is as follows:

[0060] S41. Input the instrumental variable Z selected into the data set into the trained decoupled representation generator f Φ In this paper, we obtain a new decoupled representation

[0061] S42. Decouple the new The covariate X and treatment variable T selected into the data set are respectively input into the trained R1 estimator and R0 estimator In the equation, we get the new first conditional shadow variable estimate and the new second conditional shadow variable estimate

[0062] S43, the conditional shadow variable R, covariate X and treatment variable T selected into the data set and the new decoupled representation Input to the trained first outcome variable estimator In the new first outcome variable estimate

[0063] S44. Using the new first conditional shadow variable estimate New second conditional shadow variable estimate and the new estimate of the first outcome variable The second result variable Y0 is calculated as follows;

[0064] S45, select the conditional shadow variable R, covariate X, treatment variable T and new decoupled representation into the data set Input to the second outcome variable estimator The estimated value of the second outcome variable is obtained

[0065] S46. Calculate the estimated value of the second outcome variable The mean square error between the second result variable Y0 and the result variable Y0 is used as the eighth loss function, and the eighth loss function is minimized by Estimator for the second outcome variable Update the parameters of

[0066] S47, continue iterating training until the second outcome variable estimator The loss function converges and the trained second outcome variable estimator is obtained.

[0067] Furthermore, the eighth loss function The functional form is:

[0068]

[0069] Among them, y 0,i Represents the value of the second outcome variable for the i-th sample.

[0070] As a preferred embodiment of the first aspect, in step S5, the specific process of obtaining the causal effect estimation result is as follows:

[0071] S51. Combine the population characteristics for which causal effects are to be estimated with the instrumental variables in the behavioral data Input to the trained disentangled representation generator f Φ In the above example, we obtain the decoupled representation to be processed.

[0072] S52. Combine the characteristics of the population for which you want to estimate causal effects with the instrumental variables in the behavioral data and covariates together with the input to the trained treatment variable estimator f t In the above example, we can obtain the estimated value of the treatment variable to be processed.

[0073] S53. Calculate the true value of the treatment variable in the population characteristics and behavior data for which the causal effect is to be estimated The estimated value of the treatment variable to be treated The residual between

[0074] S54. Combine the population characteristics for which causal effects are to be estimated with the conditional shadow variables to be processed in the behavioral data Covariates Decoupled representation and a processing variable set to 1 Input into the trained first outcome variable estimator and the trained estimator for the second outcome variable The corresponding estimated value of the outcome variable after the first treatment is and the estimated value of the second treated outcome variable

[0075] S55. Combine the population characteristics for which causal effects are to be estimated with the conditional shadow variables to be processed in the behavioral data Covariates Decoupled representation and a processing variable set to 1 Input to the trained sample selection probability estimator f p The estimated probability of sample selection after processing is obtained

[0076] S56. Combine the population characteristics for which causal effects are to be estimated with the conditional shadow variables to be processed in the behavioral data Covariates Decoupled representation and processing variables set to 0 Input into the trained first outcome variable estimator and the trained estimator for the second outcome variable The corresponding estimated value of the first unprocessed outcome variable is and the second untreated outcome variable estimate

[0077] S57. Combine the population characteristics for which causal effects are to be estimated with the conditional shadow variables to be processed in the behavioral data Covariates Decoupled representation and processing variables set to 0 Input to the trained sample selection probability estimator f p The unprocessed sample selection probability estimate is obtained

[0078] S58. Using the estimated value of the result variable after the first treatment Estimated value of the outcome variable after the second treatment Estimated probability of sample selection after treatment First untreated outcome variable estimate Second untreated outcome variable estimate and the untreated sample selection probability estimate The causal effect estimate τ is calculated according to the conditional probability formula of causal effect.

[0079] Furthermore, the causal effect estimate τ is calculated as:

[0080]

[0081] in, represents the estimated value of the outcome variable after the first treatment; represents the estimated probability of sample selection after treatment; 0) represents the estimated value of the outcome variable after the second treatment; represents the estimated value of the first untreated outcome variable; represents the estimated probability of selection of the untreated sample; represents the estimated value of the second untreated outcome variable.

[0082] In a second aspect, the present invention provides a product recommendation system for mixed and colliding complex deviations, including:

[0083] The data acquisition module is used to obtain the population characteristics and behavior data for causal effect estimation. It uses user and product store information as covariates, whether the product is recommended to the user as the treatment variable, the advertising channel as the instrumental variable, and whether the user purchases the product as the outcome variable.

[0084] The result acquisition module is used to input the characteristics and behavior data of the population for which causal effect estimation is desired into the causal effect estimation model obtained by the causal inference method for confounding and complex collision biases as described in any of the schemes of the first aspect above, to predict the changes in commodity transactions brought about by recommendation versus non-recommendation.

[0085] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a causal inference method for complex deviations of mixing and collision is implemented as described in any of the schemes of the first aspect above.

[0086] In a fourth aspect, the present invention provides a computer electronic device, comprising a memory and a processor;

[0087] The memory is used to store computer programs;

[0088] The processor is used to implement a causal inference method for mixed and colliding complex deviations as described in any of the solutions of the first aspect above when executing the computer program.

[0089] Compared with the prior art, the present invention has the following beneficial effects:

[0090] The present invention automatically obtains conditional shadow variables by decoupling representation learning and residual estimation, and uses the obtained conditional shadow variables to remove complex biases and obtain unbiased causal effect estimates. Compared with the traditional instrumental variable regression method that can only remove confounding bias, the present invention fully considers the possible simultaneous existence of selection bias and confounding bias in complex scenarios in reality, and realizes unbiased estimation of causal effects in complex bias scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0091] Figure 1 is a flow chart of the steps of the present invention;

[0092] Figure 2 An example cause-and-effect diagram for a scenario of the problem solved by the present invention;

[0093] Figure 3 It is a schematic diagram of the causal effect estimation model of the present invention during training;

[0094] Figure 4 It is a schematic diagram of the causal effect estimation model of the present invention during inference;

[0095] Figure 5 It is a system block diagram of the present invention. DETAILED DESCRIPTION

[0096] In order to make the above-mentioned purpose, features and advantages of the present invention more obvious and easy to understand, the specific implementation mode of the present invention is described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. The technical features in each embodiment of the present invention can be combined accordingly without conflicting with each other.

[0097] In the description of the present invention, it should be understood that the terms "first" and "second" are only used for the purpose of distinguishing descriptions, and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features.

[0098] In order to overcome the causal inference problem in complex bias scenarios that the prior art cannot apply, and to provide an instrumental variable algorithm that can simultaneously solve complex biases, the present invention proposes a causal inference method for confounding and colliding complex biases, which can be implemented in complex bias scenarios where unobserved covariates and unobserved partial outcome variable values ​​exist at the same time, using instrumental variables to simultaneously remove two biases and achieve unbiased causal effect estimation. The method of the present invention can use instrumental variables to learn decoupled representations and estimate the residuals of treatment variables, use the residuals as conditional shadow variables, regress the outcome variables together with covariates, treatment variables and decoupled representations, and perform causal effect estimation based on this.

[0099] In a preferred embodiment of the present invention, Figure 2 As shown in the figure, the instrumental variable Z, covariate X, treatment variable T and outcome variable Y are obtained from the population characteristics and behavior data, but the value of the outcome variable Y of some samples is missing. According to whether the value of the outcome variable Y is missing or not, the sample selection marker value S of each sample can also be obtained, which may be jointly affected by the instrumental variable Z, covariate X, treatment variable T and outcome variable Y, thus causing collision bias. There are also some potential covariates U in the data that have not been collected, which may affect both the treatment variable T and the outcome variable Y, causing confusion bias. Therefore, based on Figure 2 There are well-defined instrumental variables in the population characteristics and behavior data, and the causal inference method for confounding and complex collision bias of the present invention is used to estimate the unbiased causal effect.

[0100] like Figure 1 As shown, in a preferred implementation of the present invention, the above causal inference method for mixed and collision complex deviations includes the following steps S1 to S5. The specific implementation process is described in detail below.

[0101] S1. Obtain population characteristics and behavior data using population characteristics information as covariates, interventions imposed on the population as treatment variables, population behavior categories as outcome variables, and instrumental variables predefined according to expert knowledge, and divide the population characteristics and behavior data into selected sample data and unselected sample data according to whether the outcome variables can be observed, mark the two parts of data for sample selection, and use the marked selected sample data to construct a selected data set (S=1), and use the marked unselected sample data to construct an unselected data set (S=0).

[0102] It should be noted that in step S1 of the present invention, population characteristics and behavioral data are used to predict the change in the number of living children in the family brought about by women receiving seven years of education or more compared to those who do not receive seven years of education or more. According to the target task, the population characteristics and behavioral data for which causal effects are to be estimated are defined, and then divided into covariates X, instrumental variables Z, treatment variables T allocated from the observed data, and outcome variables Y. Specifically, in this embodiment, the population characteristics and behavioral data use the basic information of women and their families as covariates, the number of women receiving seven years of education or more as treatment variables, whether women were born in the first half of the year as instrumental variables, and the number of living children in the family as outcome variables. And according to whether the outcome variable can be observed, the population characteristics and behavioral data are divided into two parts: selected sample data (S=1) and non-selected sample data (S=0), where S is the sample selection mark, s i =1 refers to the outcome variable y for this individual i It can be observed that s i =0 refers to the outcome variable y for this individual i Cannot be observed.

[0103] It should also be noted that in the commodity recommendation scenario, the above-mentioned crowd characteristics and behavior data use user and commodity store information as covariates, whether the commodity is recommended to the user as the treatment variable, the advertising channel as the instrumental variable, and whether the user purchases the commodity as the result variable. In the commodity pricing scenario, the crowd characteristics and behavior data use basic information of customers and commodities as covariates, commodity prices as the treatment variable, economic level as the instrumental variable, and commodity sales volume as the result variable.

[0104] S2, jointly training the disentangled representation generator f on the selected dataset and the unselected dataset Φ and the treatment variable estimator f t , in the joint training of the disentangled representation generator f Φ and the treatment variable estimator f t When , the marker estimator f is selected by the sample s Regression estimation is performed on the sample selection markers, and the decoupled representation generated by the decoupled representation generator is constrained by the integrated probability metric to meet the conditional independence assumption to optimize the generated decoupled representation, which is processed by the variable estimator f t After regressing the treatment variable, we get the estimated value of the treatment variable. Calculate the true value T of the treatment variable and the estimated value of the treatment variable The residual R between them is used as the conditional shadow variable in the selected data set.

[0105] It should be noted that step S2 of the present invention is a process of decoupling representation generation and residual estimation. In this step, the decoupled representation generator f is first used. Φ Map the instrumental variable Z to a representation space to generate a decoupled representation Then input it together with the treatment variable and covariate into the sample selection marker estimator f s , the sample selection markers are regressed and estimated, and the decoupled representation generated by the integral probability metric constraint satisfies the conditional independence assumption, and finally the sample selection marker estimate is generated that is related to the sample selection marker and conditionally independent of the treatment variable Calculate sample selection marker estimates The cross entropy between the sample selection labels is used to update the decoupled representation generator f Φ , and input the instrumental variable Z and the covariate X into the treatment variable estimator f t , after regressing the treatment variable, we can get the estimated value of the treatment variable Calculate the true value T of the treatment variable and the estimated value of the treatment variable The residual R between them is used as the conditional shadow variable of the selected data set. The conditional independence assumption of the decoupled representation means that the decoupled representation should be related to the sample selection marker under the condition of the instrumental variable and independent of the treatment variable under the condition of the instrumental variable.

[0106] like Figure 3 As shown, in step S2 of the present invention, the decoupling representation generator f Φ , sample selection marker estimator f s and the treatment variable estimator f t The specific training process is as follows:

[0107] S21. Using decoupled representation generator f Φ Map the instrumental variables Z in the selected and unselected datasets to a representation space to generate a decoupled representation

[0108]

[0109] S22. Decouple the generated selected data set and the unselected data set The treatment variable T and covariate X are input to the sample selection marker estimator f s In the sample selection marker estimation,

[0110]

[0111] S23, input the instrumental variables Z and covariates X of the selected and unselected data sets into the treatment variable estimator f t , and obtain the estimated value of the treatment variable

[0112]

[0113] S24. Calculate the true value T and estimated value of the treatment variable in the selected data set The residual R between them is used as the conditional shadow variable of the selected data set; the calculation method of the residual R is:

[0114]

[0115] S25. Calculate sample selection marker estimate The cross entropy between the sample selection marker S and the sample selection marker S is used as the first loss function, and the sample selection marker estimator f is minimized by minimizing the first loss function. s Update the parameters of

[0116] The first loss function The functional form is:

[0117]

[0118] Where n represents the total number of samples in the selected and unselected datasets; s i ,x i ,t i ,z i They represent the sample selection marker, covariate, treatment variable and instrumental variable of the ith sample respectively;

[0119] S26, when the processing variable takes a value of 1, it is used as the processing group, and when the processing variable takes a value of 0, it is used as the control group, and the integral probability metric value between the decoupled representation of the processing group and the decoupled representation of the control group is calculated, and the integral probability metric value between the decoupled representation of the processing group and the decoupled representation of the control group is added to the first loss function as the second loss function, and the decoupled representation generator f is minimized by minimizing the second loss function. Φ Update the parameters of

[0120] The second loss function The functional form is:

[0121]

[0122] Wherein, λ is an adjustable hyperparameter. In this embodiment, λ is set to 0.001; IPM represents the integral probability metric. In this embodiment, it adopts the maximum mean difference function MMD, and the function form is as follows:

[0123]

[0124] Among them, z i ,z jRepresent the instrumental variables of the i-th and j-th samples respectively; i:t i =1 indicates the i-th sample in the treatment group, j:t j =0 represents the jth sample of the control group; m1 represents the total number of samples of the treatment group that are not selected into the data set and the selected data set; m0 represents the total number of samples of the control group that are not selected into the data set and the selected data set; k is the kernel function; ||·||2 is the L2 norm.

[0125] S27. Calculate the true value T of the treatment variable and the estimated value of the treatment variable The mean square error between them is used as the third loss function, and the processing variable estimator f is processed by minimizing the third loss function. t Update the parameters of

[0126] The third loss function The functional form is:

[0127]

[0128] S28, continue iterating training until the decoupled representation generator f Φ , sample selection marker estimator f s and the treatment variable estimator f t The loss functions of all converge, and the trained decoupled representation generator f is obtained. Φ , sample selection marker estimator f s and the treatment variable estimator f t .

[0129] S3, represented by the conditional shadow variable, the covariate X selected into the data set, the treatment variable T, and the decoupling Train the first outcome variable estimator Regression estimation of the outcome variable Y; characterized by the covariate X, treatment variable T and decoupling selected into the data set Training the R1 estimator Regression estimation is performed on the conditional shadow variable R of the selected data set; the covariate X, the treatment variable T and the decoupling representation of the unselected data set are used. Training the R0 estimator Regression estimation is performed on the conditional shadow variable R of the unselected data set; the covariate X, treatment variable T, conditional shadow variable R and decoupling representation of the selected and unselected data sets are used. Training sample selection probability estimator f p Perform regression estimates on the sample selection probabilities.

[0130] It should be noted that in step S3 of the present invention, the conditional shadow variable is combined with the covariate X, the processing variable T, and the decoupling representation together with the input to the first outcome variable estimator In the above example, the result variable Y is regressed and estimated to obtain the estimated value of the first result variable. The covariates X, treatment variables T and decoupling representations selected into the data set Enter the R1 estimator together In the above example, the conditional shadow variable R of the selected data set is regressed to obtain the estimated value of the first conditional shadow variable. The covariate X, treatment variable T and decoupling representation that are not selected into the data set Enter the R0 estimator together In the above example, the conditional shadow variable R that is not included in the data set is regressed to obtain the estimated value of the second conditional shadow variable. The covariate X, treatment variable T, conditional shadow variable R and decoupling representation of the selected and unselected data sets Input sample selection probability estimator f p , and perform regression estimation on the sample selection probability.

[0131] like Figure 3 As shown, in step S3 of the present invention, the first result variable estimator R0 Estimator R1 Estimator and the sample selection probability estimator f p The training process of is independent of each other. In this embodiment, the first outcome variable estimator R0 estimator f r0 , R1 estimator and the sample selection probability estimator f p The specific training process is as follows:

[0132] S31, select the conditional shadow variable R, covariate X, treatment variable T and decoupling representation into the data set Input to the first outcome variable estimator The estimated value of the first outcome variable is obtained

[0133]

[0134] S32, select the covariate X, treatment variable T and decoupling representation into the data set Enter the R1 estimator together In the above example, the conditional shadow variable R of the selected data set is regressed to obtain the estimated value of the first conditional shadow variable.

[0135]

[0136] S33, decouple the covariate X, treatment variable T and Enter the R0 estimator together In the above example, the conditional shadow variable R that is not included in the data set is regressed to obtain the estimated value of the second conditional shadow variable.

[0137]

[0138] S34, the covariate X, treatment variable T, conditional shadow variable R and decoupling representation of the selected and unselected data sets Input to the sample selection probability estimator f p The sample selection probability estimate is obtained

[0139]

[0140] S35. Calculate the estimated value of the first outcome variable The mean square error between the result variable Y and the result variable Y is used as the fourth loss function, and the first result variable estimator is minimized by minimizing the fourth loss function. Update the parameters of

[0141] The fourth loss function The functional form is:

[0142]

[0143] Among them, y i ,r i They represent the outcome variable and conditional shadow variable values ​​of the i-th sample, respectively, and n1 represents the total number of samples selected into the data set;

[0144] S36. Calculate the estimated value of the first conditional shadow variable The mean square error between the conditional shadow variable R and the conditional shadow variable R is used as the fifth loss function, and the R1 estimator is minimized by minimizing the fifth loss function. Update the parameters of

[0145] The fifth loss function The functional form is:

[0146]

[0147] S37. Calculate the estimated value of the second conditional shadow variable The mean square error between the conditional shadow variable R and the conditional shadow variable R is used as the sixth loss function, and the R0 estimator is minimized by minimizing the sixth loss function. Update the parameters of

[0148] The sixth loss function The functional form is:

[0149]

[0150] Among them, n0 represents the total number of samples not selected into the data set;

[0151] S38. Calculate the sample selection label predicted by the sample selection probability estimate The cross entropy between the sample selection label S is used as the seventh loss function, and the seventh loss function is minimized. Select the probability estimator f for the sample p Update the parameters of

[0152] The seventh loss function The functional form is:

[0153]

[0154] Sample Selection Tags The prediction process is as follows:

[0155]

[0156] Here, α represents a preset hyperparameter threshold, and in this embodiment, α=0.5.

[0157] S39, continue iterating training until the first outcome variable estimator R0 Estimator R1 estimator f r1 and the sample selection probability estimator f p The loss functions of all converge, and the trained first outcome variable estimator is obtained. R0 Estimator R1 Estimator and the sample selection probability estimator f p .

[0158] S4. Use the trained disentangled representation generator f Φ , treatment variable estimator f t , R1 estimator R0 Estimator and the first outcome variable estimator Calculate the second outcome variable Y0 of the selected data set; the covariate X, the treatment variable T and the decoupling representation of the selected data set Train the second outcome variable estimator Regression estimation is performed on the second outcome variable Y0.

[0159] like Figure 3As shown, in step S4 of the present invention, the second result variable estimator The specific training process is as follows:

[0160] S41. Input the instrumental variable Z selected into the data set into the trained decoupled representation generator f Φ In this paper, we obtain a new decoupled representation

[0161]

[0162] S42. Decouple the new The covariate X and treatment variable T selected into the data set are respectively input into the trained R1 estimator and R0 estimator In the equation, we get the new first conditional shadow variable estimate and the new second conditional shadow variable estimate

[0163]

[0164]

[0165] S43, the conditional shadow variable R, covariate X and treatment variable T selected into the data set and the new decoupled representation Input to the trained first outcome variable estimator In the new first outcome variable estimate

[0166]

[0167] S44. Using the new first conditional shadow variable estimate New second conditional shadow variable estimate and the new estimate of the first outcome variable The second result variable Y0 is calculated as follows:

[0168]

[0169]

[0170] S45, select the conditional shadow variable R, covariate X, treatment variable T and new decoupled representation into the data set Input to the second outcome variable estimator The estimated value of the second outcome variable is obtained

[0171]

[0172] S46. Calculate the estimated value of the second outcome variable The mean square error between the second result variable Y0 and the result variable Y0 is used as the eighth loss function, and the eighth loss function is minimized by Estimator for the second outcome variable Update the parameters of

[0173] The eighth loss function The functional form is:

[0174]

[0175] Among them, y 0,i represents the value of the second outcome variable of the i-th sample;

[0176] S47, continue iterating training until the second outcome variable estimator The loss function converges and the trained second outcome variable estimator is obtained.

[0177] S5. The trained decoupled representation generator f Φ , treatment variable estimator f t , the first outcome variable estimator Second outcome variable estimator and the sample selection probability estimator f p Together they form a causal effect estimation model, and the population characteristics and behavioral data for which causal effects are to be estimated are input into the causal effect estimation model to predict changes in population behavior brought about by intervention versus no intervention.

[0178] In an embodiment of the present invention, in the crowd characteristics and behavior data, when the basic information of women and their families is used as a covariate, the women's education of seven years or more is used as a treatment variable, whether the women were born in the first half of the year is used as an instrumental variable, and the number of living children in the family is used as the result variable, the prediction result output by the causal effect estimation model is specifically the change in the number of living children in the family caused by the women receiving seven years or more education compared to those who did not receive seven years or more education. In the commodity recommendation scenario, the above crowd characteristics and behavior data use the user and commodity store information as covariates, whether the commodity is recommended to the user as a treatment variable, the advertising delivery channel as an instrumental variable, and whether the user purchases the commodity as the result variable, and the prediction result output by the causal effect estimation model is specifically the change in commodity transaction caused by recommendation compared to non-recommendation. In the commodity pricing scenario, the above crowd characteristics and behavior data use the basic information of customers and commodities as covariates, commodity prices as treatment variables, economic levels as instrumental variables, and commodity sales as result variables, and the prediction result output by the causal effect estimation model is specifically the change in commodity sales caused by changes in commodity prices.

[0179] like Figure 4 As shown, in step S5 of the present invention, the specific process of obtaining the causal effect estimation result is as follows:

[0180] S51. Combine the population characteristics for which causal effects are to be estimated with the instrumental variables in the behavioral data Input to the trained disentangled representation generator f Φ In the above example, we obtain the decoupled representation to be processed.

[0181]

[0182] S52. Combine the characteristics of the population for which you want to estimate causal effects with the instrumental variables in the behavioral data and covariates together with the input to the trained treatment variable estimator f t In the above example, we can obtain the estimated value of the treatment variable to be processed.

[0183]

[0184] S53. Calculate the true value of the treatment variable in the population characteristics and behavior data for which the causal effect is to be estimated The estimated value of the treatment variable to be treated The residual between

[0185]

[0186] S54. Combine the population characteristics for which causal effects are to be estimated with the conditional shadow variables to be processed in the behavioral data Covariates Decoupled representation and a processing variable set to 1 Input into the trained first outcome variable estimator and the trained estimator for the second outcome variable The corresponding estimated value of the outcome variable after the first treatment is and the estimated value of the second treated outcome variable

[0187]

[0188]

[0189] S55. Combine the population characteristics for which causal effects are to be estimated with the conditional shadow variables to be processed in the behavioral data Covariates Decoupled representation and a processing variable set to 1 Input to the trained sample selection probability estimator f p The estimated probability of sample selection after processing is obtained

[0190]

[0191] S56. Combine the population characteristics for which causal effects are to be estimated with the conditional shadow variables to be processed in the behavioral data Covariates Decoupled representation and processing variables set to 0 Input into the trained first outcome variable estimator and the trained estimator for the second outcome variable The corresponding estimated value of the first unprocessed outcome variable is and the second untreated outcome variable estimate

[0192]

[0193]

[0194] S57. Combine the population characteristics for which causal effects are to be estimated with the conditional shadow variables to be processed in the behavioral data Covariates Decoupled representation and processing variables set to 0 Input to the trained sample selection probability estimator f p The unprocessed sample selection probability estimate is obtained

[0195]

[0196] S58. Using the estimated value of the result variable after the first treatment Estimated value of the outcome variable after the second treatment Estimated probability of sample selection after treatment First untreated outcome variable estimate Second untreated outcome variable estimate and the untreated sample selection probability estimate The causal effect estimate τ is calculated according to the causal effect conditional probability formula:

[0197]

[0198] in, represents the estimated value of the outcome variable after the first treatment; represents the estimated probability of sample selection after treatment; represents the estimated value of the outcome variable after the second treatment; represents the estimated value of the first untreated outcome variable; represents the estimated probability of selection of the untreated sample; represents the estimated value of the second untreated outcome variable.

[0199] It should also be noted that the decoupled representation generator f in the present invention Φ , treatment variable estimator f t , sample selection marker estimator f s , the first outcome variable estimator Second outcome variable estimator Sample selection probability estimator f p , R1 estimator and R0 estimator The specific structure of can be set according to actual needs. In this embodiment, the sample selection marker estimator f s With the sample selection probability estimator f p The structure of is the same as that of , which consists of 3 fully connected layers and a Sigmoid activation output layer. Φ , treatment variable estimator f t , the first outcome variable estimator Second outcome variable estimator R1 Estimator With the R0 estimator The structures are the same, they consist of 3 fully connected layers and a linear output layer.

[0200] The present invention will now use a specific example to demonstrate the application effect of the causal inference method for mixed and colliding complex deviations described in S1 to S5 in the above embodiments on a specific data set, so as to facilitate understanding of the essence of the present invention.

[0201] Example

[0202] The specific implementation process of the causal inference method for mixed and colliding complex deviations adopted in this embodiment is as described above and will not be repeated here.

[0203] This embodiment takes a method of dividing population characteristics and behavior data as an example, that is, the basic information of women and their families is used as covariates, the women's seven years of education or more is used as the treatment variable, whether the women are born in the first half of the year is used as the instrumental variable, and the number of living children in the family is used as the result variable. The trained causal effect estimation model is used to predict the change in the number of living children in the family caused by women receiving seven years of education or more compared with those who do not receive seven years of education or more, and the method is verified in the public Women's Education and Fertility (Fertil2) dataset. The Women's Education and Fertility (Fertil2) dataset aims to estimate the impact of women receiving at least seven years of education on the number of living children in the family. The dataset includes several observed covariates: religion, ideal number of children, and whether the women live in urban areas. The instrumental variable is whether the women were born in the first half of the year. This embodiment divides the dataset into training set, validation set, and test set based on the ratio of 63% / 27% / 10%. In order to introduce selection bias, this embodiment removes the outcome variables of people whose ideal number of children is greater than the number of living children and individuals who do not live in urban areas and have less than seven years of education, that is, sets these samples to S=0, and finally constructs the Fertil2 dataset with complex bias.

[0204] In order to objectively evaluate the performance of the method of the present invention, data shuffling and model retraining were randomly performed 10 times on the above data set, and the mean and standard deviation mean (std) of the causal effect estimation mean square error (MSE) in 10 experiments were compared with some classic and latest causal effect estimation methods.

[0205] The conditional causal effect estimation methods used for comparison include: Heckman two-stage regression model Heckit, which is derived from the prior art literature: Heckman, JJ Sample selection bias as a specification error [J]. Econometrica: Journal of the econometric society, 1979, 47 (1): 153–161. Two-stage residual intervention regression model 2SRI, which is derived from the prior art literature: Terza JV, Basu A, Rathouz P J. Two-stage residual inclusion estimation: addressing endogeneity in health econometric modeling [J]. Journal of health economics, 2008, 27 (3): 531-543. Inverse selection probability weighted model IPSW, which is derived from the prior art literature: Cole, SR and Stuart, EA Generalizing evidence from randomized clinical trials to target populations [J]. American Journal of Epidemiology, 2010, 172 (1): 107–115. The shadow variable regression model SHADOW is derived from the prior art literature: Miao W, Tchetgen Tchetgen E J. On varieties of doubly robust estimators under missingness not at random with a shadow variable [J]. Biometrika, 2016, 103 (2): 475-482. The deep instrumental variable regression model DeepIV is derived from the prior art literature: Hartford J, Lewis G, Leyton-Brown K, et al. Deep IV: A flexible approach for counterfactual prediction [C] International Conference on Machine Learning. PMLR, 2017: 1414-1423.Kernel IV, an instrumental variable regression model based on kernel function, is derived from the prior art literature: Singh R, Sahani M, Gretton A. Kernel instrumental variable regression [J]. Advances in Neural Information Processing Systems, 2019, 32. DeepGMM, an instrumental variable regression model based on deep Gaussian mixture model, is derived from the prior art literature: Bennett A, Kallus N, Schnabel T. Deep generalized method of moments for instrumental variable analysis [J]. Advances in neural information processing systems, 2019, 32. DFIV, a deep representation instrumental variable regression model, is derived from the prior art literature: Xu L, Chen Y, Srinivasan S, et al. Learning Deep Features in Instrumental Variable Regression [C] International Conference on Learning Representations. 2021. The instrumental variable regression model CB-IV for confounder balancing is derived from the prior art literature: Wu A, Kuang K, Li B, et al. Instrumental variable regression with confounder balancing [C] International Conference on Machine Learning. PMLR, 2022: 24056-24075.

[0206] Table 1. Experimental results

[0207]

[0208]

[0209] The MSE mean square error (mean(std)) experimental results of each method on the Fertil2 dataset are shown in Table 1. The results show that the method of the present invention has accurate causal effect estimation results.

[0210] It should also be noted that the causal inference method for complex and mixed collision deviations in the above embodiment can essentially be executed by a computer program or module. Therefore, similarly, based on the same inventive concept, another preferred embodiment of the present invention also provides a product recommendation system for complex and mixed collision deviations corresponding to the causal inference method for complex and mixed collision deviations provided in the above embodiment, such as Figure 5 As shown, it includes:

[0211] The data acquisition module is used to obtain the population characteristics and behavior data for causal effect estimation. It uses user and product store information as covariates, whether the product is recommended to the user as the treatment variable, the advertising channel as the instrumental variable, and whether the user purchases the product as the outcome variable.

[0212] The result acquisition module is used to input the characteristics and behavior data of the population for which causal effect estimation is desired into the causal effect estimation model obtained by the causal inference method for confounding and complex collision deviations in the above-mentioned embodiment, and predict the changes in commodity transactions brought about by recommendation versus non-recommendation.

[0213] Similarly, based on the same inventive concept, another preferred embodiment of the present invention further provides a computer electronic device corresponding to the causal inference method for mixed and colliding complex deviations provided in the above embodiment, which includes a memory and a processor;

[0214] The memory is used to store computer programs;

[0215] The processor is used to implement the causal inference method for mixed and colliding complex deviations in the above embodiment when executing the computer program.

[0216] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0217] Therefore, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer-readable storage medium corresponding to the causal inference method for complex deviations of confounding and colliding provided in the above embodiment, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the causal inference method for complex deviations of confounding and colliding in the above embodiment can be implemented.

[0218] It is understandable that the above storage medium may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage. The storage medium may also be a U disk, a mobile hard disk, a magnetic disk or an optical disk, etc., which can store program codes.

[0219] It is understandable that the above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0220] It should also be noted that those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the various embodiments provided in this application, the division of steps or modules in the system and method is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or steps can be combined or integrated together, and a module or step can also be split.

[0221] The above-described embodiment is only a preferred solution of the present invention, but it is not intended to limit the present invention. A person skilled in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.

Claims

1. A causal inference method for complex deviations of confounding and collision, characterized in that: The following steps are involved: S1. Obtaining population characteristics and behavior data with population characteristics information as covariates, interventions imposed on the population as treatment variables, population behavior categories as outcome variables, and instrumental variables predefined according to expert knowledge, and dividing the population characteristics and behavior data into selected sample data and non-selected sample data according to whether the outcome variables can be observed, marking the two parts of data for sample selection, constructing a selected data set using the marked selected sample data, and constructing a non-selected data set using the marked non-selected sample data; S2, jointly training a decoupled representation generator and a processing variable estimator on the selected data set and the unselected data set, during the joint training, regressing and estimating the sample selection mark by the sample selection mark estimator, and constraining the decoupled representation generated by the decoupled representation generator to satisfy the conditional independence assumption through the integral probability metric, so as to optimize the generated decoupled representation, and obtaining the estimated value of the processing variable after regressing and estimating the processing variable by the processing variable estimator, calculating the residual between the true value of the processing variable and the estimated value of the processing variable and using it as the conditional shadow variable of the selected data set; S3, the result variable is regressed by the conditional shadow variable and the covariate, treatment variable and decoupling representation training first result variable estimator of the selected data set; the conditional shadow variable of the selected data set is regressed by the covariate, treatment variable and decoupling representation training R1 estimator; the conditional shadow variable of the unselected data set is regressed by the covariate, treatment variable and decoupling representation training R0 estimator; the sample selection probability is regressed by the covariate, treatment variable, conditional shadow variable and decoupling representation training sample selection probability estimator of the selected and unselected data sets; S4, using the trained decoupled representation generator, the processing variable estimator, the R1 estimator, the R0 estimator and the first result variable estimator to calculate the second result variable of the selected data set; The second outcome variable estimator is trained by using the covariates, treatment variables and decoupled representations selected into the data set to perform regression estimation on the second outcome variable; S5. The trained decoupled representation generator, treatment variable estimator, first outcome variable estimator, second outcome variable estimator and sample selection probability estimator are combined to form a causal effect estimation model. The characteristics and behavior data of the population for which causal effect estimation is desired are input into the causal effect estimation model to predict the changes in population behavior brought about by intervention versus no intervention.

2. A causal inference method for mixed and colliding complex deviations as claimed in claim 1, characterized in that: The population characteristics and behavior data take the basic information of women and their families as covariates, the women’s seven years or more of education as treatment variables, whether the women were born in the first half of the year as instrumental variables, and the number of living children in the family as outcome variables. The prediction results output by the causal effect estimation model are specifically the changes in the number of living children in the family brought about by women receiving seven years or more of education compared with those who did not receive seven years or more of education; Alternatively, the population characteristics and behavior data use user and product store information as covariates, whether the product is recommended to the user as a treatment variable, the advertising channel as an instrumental variable, and whether the user purchases the product as an outcome variable, and the prediction result output by the causal effect estimation model is specifically the change in product transaction volume caused by recommendation versus non-recommendation; Alternatively, the population characteristics and behavior data use basic information of customers and products as covariates, product prices as treatment variables, economic levels as instrumental variables, and product sales volume as outcome variables, and the prediction results output by the causal effect estimation model are specifically the changes in product sales volume brought about by changes in product prices.

3. A causal inference method for mixed and colliding complex deviations as claimed in claim 1, characterized in that: In step S2, the specific training process of the decoupled representation generator and the processing variable estimator is as follows: S21, using a decoupled representation generator to map the instrumental variables in the selected data set and the unselected data set to a representation space to generate a decoupled representation; S22, inputting the generated decoupled representations, processing variables and covariates of the selected data set and the unselected data set into the sample selection marker estimator to obtain the sample selection marker estimation value; S23, inputting the instrumental variables and covariates of the selected data set and the unselected data set into the treatment variable estimator to obtain the estimated value of the treatment variable; S24, calculating the residual between the true value of the treatment variable in the selected data set and the estimated value of the treatment variable as the conditional shadow variable of the selected data set; S25, calculating the cross entropy between the sample selection marker estimation value and the sample selection marker and using it as a first loss function, and updating the parameters of the sample selection marker estimator by minimizing the first loss function; S26, when the processing variable takes a value of 1, the processing group is used as the processing group, and when the processing variable takes a value of 0, the processing group is used as the control group, and the integral probability metric value between the decoupled representation of the processing group and the decoupled representation of the control group is calculated, and the integral probability metric value is added to the first loss function as the second loss function, and the parameters of the decoupled representation generator are updated by minimizing the second loss function; S27, calculating the mean square error between the true value of the processing variable and the estimated value of the processing variable and using it as a third loss function, and updating the parameters of the processing variable estimator by minimizing the third loss function; S28. Continuously iterate the training until the loss functions of the decoupled representation generator, the sample selection label estimator, and the processing variable estimator converge, thereby obtaining the trained decoupled representation generator, the sample selection label estimator, and the processing variable estimator.

4. A causal inference method for mixed and colliding complex deviations as claimed in claim 1, characterized in that: In step S3, the specific training process of the first outcome variable estimator, the R0 estimator, the R1 estimator and the sample selection probability estimator is as follows: S31, inputting the conditional shadow variables, covariates, treatment variables and decoupling representations selected into the data set into the first outcome variable estimator to obtain the first outcome variable estimation value; S32, inputting the covariates, treatment variables and decoupling representation of the selected data set into the R1 estimator, performing regression estimation on the conditional shadow variables of the selected data set, and obtaining a first conditional shadow variable estimation value; S33, inputting the covariates, treatment variables and decoupling representations that are not selected into the data set into the R0 estimator, performing regression estimation on the conditional shadow variables that are not selected into the data set, and obtaining a second conditional shadow variable estimate; S34, inputting the covariates, treatment variables, conditional shadow variables and decoupling representations of the selected data set and the unselected data set into the sample selection probability estimator to obtain the sample selection probability estimation value; S35, calculating the mean square error between the first result variable estimate and the result variable and using it as a fourth loss function, and updating the parameters of the first result variable estimator by minimizing the fourth loss function; S36, calculating the mean square error between the estimated value of the first conditional shadow variable and the conditional shadow variable and using it as the fifth loss function, and updating the parameters of the R1 estimator by minimizing the fifth loss function; S37, calculating the mean square error between the estimated value of the second conditional shadow variable and the conditional shadow variable and using it as the sixth loss function, and updating the parameters of the R0 estimator by minimizing the sixth loss function; S38, calculating the cross entropy between the sample selection label predicted by the sample selection probability estimate and the sample selection mark and using it as the seventh loss function, and updating the parameters of the sample selection probability estimator by minimizing the seventh loss function; S39, continuously iterate the training until the loss functions of the first outcome variable estimator, R0 estimator, R1 estimator and sample selection probability estimator all converge, thereby obtaining the trained first outcome variable estimator, R0 estimator, R1 estimator and sample selection probability estimator.

5. The causal inference method for mixed and colliding complex deviations as claimed in claim 1, characterized in that: In step S4, the specific training process of the second outcome variable estimator is as follows: S41, inputting the instrumental variables selected into the data set into the trained decoupled representation generator to obtain a new decoupled representation; S42, inputting the new decoupled representation and the covariates and treatment variables selected into the data set into the trained R1 estimator and R0 estimator respectively, and obtaining a new first conditional shadow variable estimate and a new second conditional shadow variable estimate accordingly; S43, inputting the conditional shadow variables, covariates, and treatment variables selected into the data set and the new decoupled representation into the trained first outcome variable estimator to obtain a new first outcome variable estimate; S44, using the new estimated value of the first conditional shadow variable, the new estimated value of the second conditional shadow variable and the new estimated value of the first result variable, calculate the second result variable according to the following formula; S45, inputting the conditional shadow variable, covariate, treatment variable and new decoupled representation selected into the data set into the second outcome variable estimator to obtain an estimated value of the second outcome variable; S46, calculating a mean square error between the second result variable estimate and the second result variable and using the mean square error as an eighth loss function, and updating the parameters of the second result variable estimator by minimizing the eighth loss function; S47. Continuously iterate the training until the loss function of the second outcome variable estimator converges, thereby obtaining a trained second outcome variable estimator.

6. A causal inference method for mixed and colliding complex deviations as claimed in claim 1, characterized in that: In step S5, the specific process of obtaining the causal effect estimation result is as follows: S51. Combine the population characteristics for which causal effects are to be estimated with the instrumental variables in the behavioral data Input into the trained decoupled representation generator to obtain the decoupled representation to be processed; S52, inputting the population characteristics for which causal effects are to be estimated together with the instrumental variables and covariates in the behavioral data into the trained treatment variable estimator to obtain the estimated value of the treatment variable to be processed; S53, calculating the residual between the true value of the treatment variable in the population characteristics and behavior data for which causal effects are to be estimated and the estimated value of the treatment variable to be treated as the conditional shadow variable to be treated; S54, inputting the conditional shadow variables, covariates, decoupling representations and treatment variables set to 1 in the population characteristics and behavior data for which causal effects are to be estimated into the trained first outcome variable estimator and the trained second outcome variable estimator, respectively, to obtain the first processed outcome variable estimate and the second processed outcome variable estimate; S55, inputting the conditional shadow variables, covariates, decoupling representations and treatment variables set to 1 in the population characteristics and behavior data for which causal effects are to be estimated into the trained sample selection probability estimator to obtain the sample selection probability estimate after processing; S56, inputting the conditional shadow variables, covariates, decoupling representations, and treatment variables set to 0 in the population characteristics and behavior data for which causal effects are to be estimated into the trained first outcome variable estimator and the trained second outcome variable estimator, respectively, to obtain the first unprocessed outcome variable estimate and the second unprocessed outcome variable estimate; S57, inputting the conditional shadow variables, covariates, decoupling representations and treatment variables set to 0 in the population characteristics and behavior data for which causal effects are to be estimated into the trained sample selection probability estimator to obtain an estimated value of the unprocessed sample selection probability; S58. Calculate the causal effect estimate according to the causal effect conditional probability formula using the first processed outcome variable estimate, the second processed outcome variable estimate, the processed sample selection probability estimate, the first unprocessed outcome variable estimate, the second unprocessed outcome variable estimate, and the unprocessed sample selection probability estimate.

7. A causal inference method for mixed and colliding complex deviations as claimed in claim 6, characterized in that: In step S5, the causal effect estimate τ is calculated as follows: in, represents the estimated value of the outcome variable after the first treatment; represents the estimated probability of sample selection after treatment; represents the estimated value of the outcome variable after the second treatment; represents the estimated value of the first untreated outcome variable; represents the estimated probability of selection of the untreated sample; represents the estimated value of the second untreated outcome variable.

8. A product recommendation system for complex and mixed deviations, characterized in that: include: The data acquisition module is used to obtain the population characteristics and behavior data for causal effect estimation. It uses user and product store information as covariates, whether the product is recommended to the user as the treatment variable, the advertising channel as the instrumental variable, and whether the user purchases the product as the outcome variable. The result acquisition module is used to input the characteristics and behavior data of the population for which causal effect estimation is desired into the causal effect estimation model obtained by the causal inference method for confounding and complex collision deviations as described in any one of claims 1 to 7, and predict the changes in commodity transactions brought about by recommendation versus non-recommendation.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the causal inference method for mixed and colliding complex deviations as described in any one of claims 1 to 7 is implemented.

10. A computer electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is used to implement the causal inference method for mixed and colliding complex deviations as described in any one of claims 1 to 7 when executing the computer program.