Anti-factual reasoning under rank retention

By acquiring and analyzing observation data sets, determining observation results for different disposals, and generating prediction results, the difficult problems of counterfactual reasoning in the prior art are solved, and effective reasoning and decision support are achieved under the ordering and retention.

CN119816845APending Publication Date: 2025-04-11BEIJING TECH & BUSINESS UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202480003588.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In counterfactual reasoning, it is difficult for the prior art to effectively solve the problems of answering higher-level inquiries based on lower-level information, especially at the difficult level of counterfactual reasoning, and it is difficult to explore the potential impact of disposal on the results.

Method used

By acquiring the observation data sets associated with the multiple disposals and the multiple observation objects, observation results of observation objects assigned with different disposals are determined, and based on these results, a prediction result of the target observation object being assigned with the second disposal is generated.

Benefits of technology

The counterfactual reasoning under sorting retention is achieved, providing valuable insights in credit allocation, root cause analysis, and ensuring fair algorithmic decision-making scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119816845A_ABST
    Figure CN119816845A_ABST
Patent Text Reader

Abstract

A method for anti-factual reasoning includes: obtaining a set of observation data associated with a plurality of treatments and a plurality of observation objects; determining, from the observation data set, a first set of observation results of a first set of observation objects to which a first treatment among the plurality of treatments is allocated, for a target observation object among the plurality of observation objects, the target observation object to which the first treatment is allocated; determining, from the observation data set, a second set of observation results of a second set of observation objects assigned with a second treatment different from the first treatment; and generating a prediction result in which the target observation object is assigned with the second treatment based on the first group of observation results, the second group of observation results, and a target observation result of the target observation object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The disclosed example embodiments relate generally to machine learning, and more particularly, to methods, apparatus, devices, and computer-readable storage media for counterfactual reasoning under rank preservation. Background Art

[0002] In general, answering higher-level queries based on lower-level information is challenging. Of these, counterfactual reasoning represents the most difficult level. Given knowledge about different observed treatments and actual outcomes, counterfactual reasoning involves exploring the potential impact of the treatment on the outcome. For example, consider a patient who previously did not take a medication and is now experiencing a headache. A counterfactual query would be to determine whether the headache would have occurred if the patient had taken the medication from the beginning. Solving such counterfactual queries can provide valuable insights in scenarios such as credit assignment, root cause analysis, and ensuring fair algorithmic decisions. Summary of the invention

[0003] In a first aspect of the present disclosure, a method for counterfactual reasoning is provided. The method includes: obtaining an observation data set associated with multiple treatments and multiple observation objects, wherein the observation data set includes multiple observation samples, the observation samples correspond to observation objects assigned with treatments among the multiple treatments, and include observation features of the observation objects and observation results of the observation objects; for a target observation object among the multiple observation objects, determining from the observation data set a first group of observation results of a first group of observation objects assigned with a first treatment among the multiple treatments, wherein the target observation object is assigned with the first treatment; determining from the observation data set a second group of observation results of a second group of observation objects assigned with a second treatment, the second treatment being different from the first treatment; and generating a prediction result that the target observation object is assigned with the second treatment based on the first group of observation results, the second group of observation results, and the target observation result of the target observation object.

[0004] In a second aspect of the present disclosure, a device for counterfactual reasoning is provided. The device includes: a data set acquisition module, which is configured to acquire an observation data set associated with multiple treatments and multiple observation objects. Wherein the observation data set includes multiple observation samples, the observation samples correspond to the observation objects assigned with treatments in multiple treatments among the multiple observation objects, and include the observation features of the observation objects and the observation results of the observation objects; a first result determination module, which is configured to determine, for a target observation object among the multiple observation objects, a first group of observation results of a first group of observation objects assigned with a first treatment in multiple treatments from the observation data set, wherein the target observation object is assigned with a first treatment; a second result determination module is configured to determine a second group of observation results of a second group of observation objects assigned with a second treatment from the observation data set, and the second treatment is different from the first treatment; and a prediction result generation module, which is configured to generate a prediction result that the target observation object is assigned with a second treatment based on the first group of observation results, the second group of observation results and the target observation result of the target observation object.

[0005] In a third aspect of the present disclosure, an electronic device is provided. The device includes: at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions that can be executed by the at least one processing unit. When the instructions are executed by the at least one processing unit, the device performs the method of the first aspect.

[0006] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, which, when executed by a processor, enables the method of the first aspect to be implemented.

[0007] It should be understood that the contents described in the summary of the invention are neither intended to point out the key or essential features of the embodiments of the present disclosure, nor intended to limit the scope of the present disclosure. Other features of the present disclosure will be easily conceived through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0009] Figure 1 A schematic diagram showing an example environment in which embodiments of the present disclosure may be implemented;

[0010] Figure 2A shows the directed acyclic graph (DAG) in the structural causal model (SCM);

[0011] Figure 2B Twin networks with homogeneous and heterogeneous background variables are shown;

[0012] Figure 2C Another twin network with homogeneous and heterogeneous background variables is shown;

[0013] Figure 3 A schematic diagram showing a counterfactual reasoning architecture according to some embodiments of the present disclosure is shown;

[0014] Figure 4 A flowchart showing a process for counterfactual reasoning according to some embodiments of the present disclosure is shown;

[0015] Figure 5 A block diagram showing an apparatus for counterfactual reasoning according to some embodiments of the present disclosure; and

[0016] Figure 6 A block diagram of an electronic device is shown in which one or more embodiments of the present disclosure may be implemented. DETAILED DESCRIPTION

[0017] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for illustrative purposes and are not intended to limit the scope of protection of the present disclosure.

[0018] In the description of the embodiments of the present disclosure, the term "including" and similar terms will be understood as open inclusion, that is, "including but not limited to". The term "based on" will be understood as "based at least in part on". The term "one embodiment" or "embodiment" will be understood as "at least one embodiment". The term "some embodiments" will be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below. As used herein, the term "model" can represent the degree of match between various data. For example, the above-mentioned degree of match can be obtained based on various technical solutions currently available and / or to be developed in the future.

[0019] It should be understood that the data involved in this technical proposal (including but not limited to the data itself, data acquisition or use) should comply with the requirements of relevant laws, regulations and relevant provisions.

[0020] It should be understood that before using the technical solution disclosed in each embodiment of the present disclosure, the user should be notified of the type, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure in an appropriate manner in accordance with relevant laws and regulations, and the user's authorization should be obtained.

[0021] For example, in response to receiving an activity request from a user, a prompt message is sent to the user to explicitly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Therefore, the user can choose whether to provide personal information to the software or hardware (such as an electronic device, application, server, or storage medium) that performs the operation of the technical solution of the present disclosure according to the prompt information.

[0022] As an optional but non-limiting implementation, in response to receiving the user's activity request, the method of sending the prompt information to the user may be, for example, a pop-up window, wherein the prompt information may be presented in text. In addition, the pop-up window may also include a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0023] It should be understood that the above notification and acquisition of the user authorization process are merely illustrative and do not limit the embodiments of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the embodiments of the present disclosure.

[0024] As used herein, the term "model" can learn the correlation between the corresponding input and the output from the training data, so that the corresponding output can be generated for the given input after the training is completed. The generation of the model can be based on machine learning technology. Deep learning is a machine learning algorithm that processes the input and provides the corresponding output by using multiple layers of processing units. A neural network model is an example of a model based on deep learning. As used herein, a "model" may also be referred to as a "machine learning model", "learning model", "machine learning network" or "learning network", and these terms are used interchangeably herein.

[0025] A "neural network" is a type of machine learning network based on deep learning. A neural network is capable of processing an input and providing a corresponding output, and typically includes an input layer and an output layer and one or more hidden layers between the input layer and the output layer. Neural networks used in deep learning applications typically include many hidden layers, thereby increasing the depth of the network. The layers of a neural network are connected sequentially so that the output of the previous layer is provided as input to the next layer, where the input layer receives the input of the neural network and the output of the output layer serves as the final output of the neural network. Each layer of a neural network includes one or more nodes (also called processing nodes or neurons), each of which processes the input from the previous layer.

[0026] Generally, machine learning can be roughly divided into three stages, namely the training stage, the testing stage and the application stage (also called the reasoning stage). During the training stage, a given model can be trained using large-scale training data, and the parameter values ​​are iteratively updated until the model can obtain consistent reasoning that meets the expected goals from the training data. Through training, it can be considered that the model learns the correlation between input and output (also known as input-to-output mapping) from the training data. Determine the parameter values ​​of the trained model. In the testing stage, the test input is applied to the trained model to test whether the model can provide the correct output, thereby determining the performance of the model. In the application stage, the model can be used to process the actual input and determine the corresponding output based on the parameter values ​​obtained from the training.

[0027] By Y x The term "predicted outcome" here refers to the outcome that would occur for each individual if each individual were assigned a particular treatment x. For example, given two treatments x and x', each individual would have two predicted outcomes Y x and Y x’ .

[0028] The term “counterfactual” refers to the rejection and reformulation of past facts to construct possible hypothetical outcomes. In other words, the term “counterfactual” refers to a hypothetical scenario that contradicts known past facts. For example, for each individual in the group that received treatment x, the observed outcome was Y. x , and the unobserved counterfactual outcome is Y x’ In contrast, for the other group that received treatment x', the observed outcome is Y x ’ , and the unobserved counterfactual outcome is Y x .

[0029] Figure 1 A block diagram of an example environment 100 is shown in which various embodiments of the present disclosure may be implemented. Figure 1 In the environment 100 of FIG. 1 , a computer system 110 obtains an observation data set 120 associated with multiple treatments and multiple observation objects. The observation data set 120 includes multiple observation samples. The observation sample 125 corresponds to an observation object in the multiple observation objects 105. The computer system 110 processes the multiple observation samples 125 to generate counterfactual information 130. The counterfactual information 130 may include a prediction result of the observation object 105.

[0030] The observation sample 125 corresponds to the observation object 105 to which the treatment 121 among the plurality of treatments is assigned, and includes an observation feature 123 of the observation object 105 and an observation result 122 of the observation object 105 .

[0031] An example of the observation object 105 may be a subject such as a patient. An example of the treatment 121 may be a medical treatment. In some embodiments, the plurality of treatments 121 may include a first treatment and a second treatment, one of the first treatment and the second treatment may include applying a specific medical treatment to the subject and not applying the specific medical treatment to the subject. The other of the first treatment and the second treatment may include applying a specific medical treatment to the subject and not applying the specific medical treatment to the subject.

[0032] As an example, in a medical study, operation or treatment X indicates whether a patient receives aspirin, outcome Y indicates whether the patient's headache disappears, and feature Z may include information such as the patient's age, gender, blood pressure, etc. A first set of observation samples may include feature Z of multiple patients who received aspirin, and whether their headaches disappeared after taking the medication; while a second set of observation samples may include feature Z of multiple patients who did not receive aspirin, and whether their headaches disappeared. Based on such observation samples, computer system 110 may generate a model and use the model to predict whether the target subject's headache will disappear with and without taking aspirin, and predict the treatment effect of aspirin on the target subject, to determine or help determine whether the target subject should receive the treatment of aspirin.

[0033] As another example, a treatment may be to recommend a first media content to a user, and another treatment may be to recommend a second media content to a user. The results may indicate user engagement. A first set of observation samples may include characteristics and engagement levels of users to whom the first media content was recommended. A second set of observation samples may include characteristics and engagement levels of users to whom the second media content was recommended. Using these observation samples, the computer system 110 may generate a prediction model. The model may then be employed to predict user engagement in the case of the first media content and in the case of the second media content. The prediction may be used to determine or help determine which types of media content should be recommended to which users.

[0034] exist Figure 1 In the present invention, the computer system 110 may include any computing system with computing capabilities, such as various computing devices / systems, terminal devices, servers, etc. The terminal device may include any type of mobile terminal, fixed terminal or portable terminal, including a mobile phone, a desktop computer, a laptop computer, a netbook, a tablet computer, a media computer, a multimedia tablet computer, or any combination thereof, including accessories and peripheral devices of these devices or any combination thereof. Servers include, but are not limited to, mainframes, edge computing nodes, computing devices in a cloud environment, etc.

[0035] It should be understood that the structure and function of each element in the environment 100 is described for illustrative purposes only and does not imply any limitation on the scope of the present disclosure.

[0036] As described above, in many scenarios, it is desirable to predict the outcome of an individual after receiving a certain treatment and to predict the difference in the outcomes of individuals receiving different treatments, that is, the individual causal effect (ITE). In this way, a computer system can automatically make decisions or help people make decisions, that is, determine whether to perform a specific treatment on an individual or determine which of multiple treatments to perform on an individual. For example, it is desirable to predict the possible effects of a specific drug or treatment on a patient's condition, thereby automatically or helping a physician develop a treatment plan. It is desirable to predict the extent to which a training course can improve a student's performance, or to predict the impact of an advertisement on a consumer's final purchasing behavior. In order to make such predictions, counterfactual information needs to be known.

[0037] Unlike interventional inquiry, which is prospective and estimates counterfactual outcomes in the hypothetical world based only on observations taken before the treatment (which are considered pre-treatment variables), counterfactual reasoning is retrospective and also considers factual outcomes in the observed world (which are considered post-treatment variables). The inherent conflict between the hypothetical world and the observed world presents unique challenges, making counterfactual outcomes often unidentifiable, even in randomized controlled trials (RCTs).

[0038] A three-step procedure - abduction, action and prediction - has been proposed for counterfactual reasoning to estimate counterfactual outcomes. However, this approach depends on the availability of an SCM that provides a complete description of the data generating process. In real-world applications, the true SCM is often unknown, and additional assumptions are necessary to estimate it to ensure identifiability, such as assuming linearity and additive noise. Unfortunately, these assumptions are difficult to meet in practice, which limits the applicability of the model.

[0039] To address the above issues, various counterfactual learning methods have been proposed, each based on different assumptions of identifiability. For example, the identifiability of counterfactual outcomes has been established under the assumptions of homogeneity and strict monotonicity. The homogeneity assumption states that, given the characteristics, the exogenous variables for each individual remain constant across various intervention settings, while the strict monotonicity assumption assumes that the outcome is a strictly monotonic function of the exogenous variables.

[0040] In terms of counterfactual learning, using the three-step process mentioned previously, this initially requires the estimation of the SCM. In addition, quantile regression has been proposed to estimate counterfactual outcomes, effectively bypassing the need for SCM estimation. However, this approach depends on the strict assumption that the conditional quantile functions for different counterfactual outcomes are derived from the same model. This approach also requires the estimation of unique quantile values ​​for each individual, leading to a complex second-level optimization problem.

[0041] To better understand example embodiments of the present disclosure, the following will describe the problem setting and provide necessary background on conformal prediction.

[0042] Throughout this paper, capital letters represent random variables and lowercase letters represent their specific implementations. Cause and effect diagram and a set of structural equation models composition. The nodes in are divided into two categories. The first category includes exogenous variables U = (U1, ..., U p ), which represent the environment during data generation and are assumed to be independent of each other. The second category consists of endogenous variables V = {V1, ..., V p}, which represents the relevant features required to model the problem of interest. j , whose value is given by the structural equation V j =f j (PA j , U j ) is determined, where j = 1, ..., p, and PA j V j The parent group of . SCM provides a formal language for describing how variables interact and how the resulting distribution will change in response to a specific intervention. Based on SCM, the following section will introduce the problem of counterfactual reasoning.

[0043] Assume that there exists a system consisting of X, Y and Three sets of variables are represented, where counterfactual reasoning revolves around the question: "Given the evidence E=e, what would have happened if X had been set to a different value x'?" It is proposed to answer this question using the three-step process mentioned earlier.

[0044] In the abductive step, the value of U is determined based on the evidence E = e. In the action step, the model is modified by removing the structural equation for X and replacing it with X = x'. The modified model In the prediction step, The values ​​of and U are used to calculate the counterfactual outcome for Y.

[0045] In this paper, the focus is on estimating the counterfactual outcome for each individual. To illustrate the main idea, a common counterfactual reasoning problem is formulated in the context of the backdoor criterion.

[0046] Let V = (Z, X, Y), where X causes Y, Z affects both X and Y, and the structural equation for Y is given by: Y=f Y (X,Z,U X ). (1)

[0047] Figure 2A A typical causal diagram for this setting is shown, where the exogenous variables X and Z are omitted because they will not be used throughout this work. x′ Denotes a potential outcome. The counterfactual question is: “Given evidence for an individual (X = x, Z = z, Y = y), what happens if we set X = x′ for that individual?” Formally expressed as estimating y x′ , that is, Y for an individual x′ In this paper, following the deterministic view, we will x′ The value of is considered as a fixed constant.

[0048] According to the three-step process for counterfactual reasoning mentioned above, given the evidence for an individual (X = x, Z = z, Y = y), we can determine the structural equation f for that individual Y and U X The value of Y x′ This is the key idea behind most existing methods.

[0049] The following will clarify the challenges inherent in counterfactual reasoning. This clarification helps to analyze the current approach more thoroughly. The main challenge in counterfactual reasoning is the identifiability of θ, which is generally not achievable even in RCT. By definition, θ involves two "different worlds" at the same time: the observed world with (X=x, Z=z, Y=y) and the hypothetical world in which X=x'. The factual outcome Y x = y is observed, but the counterfactual outcome Y x′ is never observed, which presents a fundamental problem in causal inference. This inherent conflict prevents reducing θ to an arithmetic expression, making it generally unrecognizable even in RCTs. The problem is specific to counterfactual reasoning and does not arise in intervention expressions, because or The statistics of the intervention distribution of is defined only in a single world, where the treatment X is set to x′ by the intervention.

[0050] Unlike dispositional expressions that do not present this problem, counterfactual reasoning requires additional assumptions beyond the widely used ones, such as conditional exchangeability, overlap, and consistency, to ensure identifiability.

[0051] Estimating θ is essentially estimating the individual treatment effect Y x′ -Y x However, by The conditional average treatment effect (CATE) given by , represents the average treatment effect (ATE) for the subgroup with Z = z, potentially ignoring the effects of noise (such as U x ) due to inherent heterogeneity within this subgroup.

[0052] Existing solutions will be summarized in terms of both identifiability assumptions and estimation strategies.

[0053] For clarity, we first present an equivalent expression of Eq. (1), incorporating the counterfactual (Y x , Y x′ ). Equation (1) can be restated as the following system: Y x =f Y (x,Z,U x ),Y x′ =f Y (x′,Z,U x′ ), (2) Among them U x and U x′ They represent U in the observed world X = x and the hypothetical world X = x′ respectively. X The value of U x and U x′ The differences between can be caused by changes in unmeasured background variables between the two worlds, a detailed discussion of which is provided in the following sections.

[0054] For identification, existing solutions rely on two key assumptions: homogeneity and strict monotonicity.

[0055] Assumption 1 is about homogeneity: U x =U x′ , which implies that for each individual U X The value of remains constant at different values ​​of x.

[0056] Assumption 2 is about strict monotonicity: for any given x and z, ff Y (x,z,U x ) is U x A smooth and strictly monotonic function of x =f Y (x,z,U x ) indicates that from Ux To Y x Assumption 2 implies that Y x is the U in the subgroup (X=x, Z=z) x is a strictly monotonic function. In addition, in Assumption 2, f Y (x,z,U x ) has similar smoothness and strict monotonicity to Y x and U x The bijective mappings between serve the same purpose and will therefore not be further distinguished.

[0057] The identifiability of θ depends on Assumptions 1 and 2 above. Lemma 3 summarizes the identifiability results.

[0058] Lemma 3 is under Assumptions 1 and 2, and θ is identifiable. Lemma 3 presents less stringent identifiability assumptions because these identifiability assumptions introduce additional assumptions, including the variability used to estimate the SCM.

[0059] For the estimation of θ, the three-step process mentioned above is adopted. Based on θ and the conditional distribution The τth * The corresponding quantiles are found using quantile regression, where τ * yes Further details are provided in the following sections.

[0060] There are limitations regarding the identification and estimation of existing solutions, which will be described in detail below.

[0061] As outlined in Hypothesis 1 and discussed further in the following sections, Figure 2B and Figure 2C The twin networks corresponding to homogeneous and heterogeneous background variables are shown respectively. Figure 2B As shown, Assumption 1 imposes a strict restriction on U that may be unrealistic. x =U x′ The exogenous variable U X Represents background and environmental information affected by many unmeasured factors. X and U x′ Capture Y in the observed world and the hypothetical world respectively x and Y x′ These worlds may have varying degrees of noise due to unmeasured factors. Figure 2C As shown, U x Variations with different values ​​of x will better reflect unobserved, unsystematic variations in different potential outcomes, which renders U x and U x′ The difference between.

[0062] In addition, in Assumption 2, f Y The strict monotonicity of excludes scenarios with discrete Y with finite support and continuous Y that may result in ties. In these cases, the unique U X Different individuals with different values ​​of y may produce the same value of Y, thus violating the requirement of strict monotonicity. Therefore, the assumption of strict monotonicity also limits the applicability of existing methods.

[0063] To estimate θ, we first follow a three-step process, which requires estimating the individual f Y and U X However, this approach requires additional assumptions, such as linearity and the presence of additive noise. Alternatively, quantile regression is used to circumvent the problem of estimating f Y and U X Challenges associated with this approach. This approach fits a single model to determine the conditional quantile functions for both the counterfactual and the factual outcomes. The effectiveness of this approach depends on the assumption that the conditional quantile functions for the different treatment groups are derived from the same model. Furthermore, this approach requires estimating a unique quantile value for each individual before deriving the counterfactual outcome, leading to a complex two-level optimization challenge.

[0064] In order to address at least some of the above limitations, an embodiment of the present disclosure proposes an improved solution for counterfactual reasoning under rank preservation. In this solution, an observation data set associated with multiple treatments and multiple observation objects is obtained. The observation data set includes multiple observation samples. The observation samples correspond to observation objects assigned with treatments in multiple treatments among the multiple observation objects, and include observation features of the observation objects and observation results of the observation objects. For a target observation object among the multiple observation objects, a first group of observation results of a first group of observation objects assigned with a first treatment in multiple treatments is determined from the observation data set. The target observation object is assigned with a first treatment. A second group of observation results of a second group of observation objects assigned with a second treatment is determined from the observation data set, and the second treatment is different from the first treatment. Based on the first group of observations, the second group of observations and the target observation results of the target observation object, a prediction result that the target observation object is assigned with a second treatment is generated. From the example embodiments described below, the advantages of the proposed solution will be apparent.

[0065] Example embodiments of the present disclosure will be described with reference to the accompanying drawings.

[0066] Reference now Figure 3 , which shows a schematic diagram of a counterfactual reasoning architecture 300 according to some embodiments of the present disclosure. The target observation object 304 is Figure 1 The counterfactual reasoning architecture 300 can be used in Figure 1The following will refer to the environment 100 in which Figure 1 Give a description.

[0067] The target observation object 304 is assigned a first treatment (denoted as x). The target observation feature 302 (denoted as z) of the target observation object 304 can be obtained from the observation data set 120. The target observation feature 302 may include any suitable information of the target observation object 304, which can be used to characterize the target observation object 304. As a result of applying the first treatment, a target observation result 310 (denoted as y) of the target observation object 304 is obtained.

[0068] The target observation object 304 is assigned the first treatment. A first set of observation results 320 (denoted as Y) of a first set of observation objects that are also assigned the first treatment is determined from the observation data set 120. x ).

[0069] Some other observations are assigned a second treatment (denoted as x'). The second treatment is different from the first treatment. A second set of observations 330 (denoted as Y) assigned to the second treatment is determined from the observation data set 120. x’ ).

[0070] Assume that the target observation 304 is assigned the second treatment. If the target observation 304 is assigned the second treatment x′, a prediction result 340 (denoted as t) of the target observation 304 is generated based on the first set of observations 320 , the second set of observations 330 , and the target observation 310 .

[0071] To better understand the predictions of outcome 340, some basic aspects are now described. Below, the identifiability assumptions, namely assumptions 1 and 2, are relaxed. From a high-level perspective, identifying θ essentially involves establishing Y x and Y x′ The three-step process estimates f based on the observed data. Y and U X To achieve this, the relaxed identifiability assumption is based on the rank correlation coefficient, which is defined as follows.

[0072] Definition 1 is described below. Let (x1, y1), ..., (x n ,y n ) is a set of observations of two random variables (X, Y) such that x i and i All values ​​of are unique (ignoring ties for simplicity). Any pair (x i ,y i ) and (x j ,y j ), if (x j -xi )(y j -y i )>0, they are said to be consistent; otherwise, they are inconsistent. The Kendall rank correlation coefficient is defined as: Where n(n-1) / 2 is the total number of combinations and sign(t)=-1, 0, 1 for t<0, t=0, t>0 respectively.

[0073] The coefficient ρ(X, Y) can also be expressed as 2(N c -N d ) / n(n-1), where N c is the number of consistent pairs, N d is the number of discordant pairs. Clearly, -1≤ρ(X, Y)≤1, and if there is perfect identity (ie, perfect agreement) between the two arrangements, then ρ(X, Y)=1.

[0074] Assumption 3 about sort preservation: ρ(Y x , Y x′ |Z)=1.

[0075] For an individual with observation (X=x, Z=z, Y=y), x =y,y x′ ) is recorded as (Y x , Y x′ ). Assumption 3 implies that for this individual, y x and x′ The sorting is respectively in the distribution and Therefore, there exists:

[0076] Since we observe y x =y, and according to the backdoor criterion (i.e., ) can be used separately and Identify the distribution and Based on this, there is the following Proposition 1.

[0077] Proposition 1 Under Assumption 3, θ is identified as The τth * Quantile, where τ * yes The quantile of y in the distribution of

[0078] Proposition 1 shows that Assumption 3 can be used as an alternative to Assumptions 1 and 2 in identifying θ. Furthermore, it has been shown that Assumption 3 is strictly weaker than Assumptions 1 and 2, as shown in Proposition 2.

[0079] Proposition 2 states that Hypotheses 1 and 2 imply Hypothesis 3, but not vice versa.

[0080] Proposition 2 is intuitive because correlation (Assumption 3) does not necessarily imply identity (Assumption 1). In fact, Assumptions 1 and 2 are special cases of Assumption 3. Below, an example is provided where Assumption 1 is violated but Assumption 2 still holds.

[0081] Assumption 3 mitigates Assumption 1. Next, the focus is on further relaxing Assumption 2. When the outcome Y is a discrete variable or a continuous variable with linked observations, by Definition 1, ρ(Y x , Y x′ ) will always be less than 1. To accommodate this situation, a modified version of the Kendall rank correlation coefficient given below is introduced.

[0082] Definition 2 is described below. Let (x1, y1), ..., (x n ,y n ) are observations of two random variables (X, Y), the modified Kendall rank correlation coefficient is defined as: Where T x is {x1, ..., x n}, and T y is {y1, ..., y n} is the number of linked pairs in .

[0083] By comparing Definition 2 with Definition 1, we can see that ρ m (X, Y) adjusts ρ(X, Y) by eliminating the tie in the denominator, and if there is no tie, then ρ m (X, Y) is reduced to ρ(X, Y).

[0084] Assumption 4 about sort preservation: ρ m (Y x , Y x′ |Z)=1.

[0085] Assumption 4 is less restrictive than Assumption 3 because it can accommodate a wider range of data types for Y. To illustrate, consider a data set with four individuals, where (Y x , Y x′ ) is (1, 1), (2, 1.5), (2, 1.5), (3, 2.5). In this scenario, Σ 1≤i<j≤n sign((y i,x -yj,x )(y i,x′ -y j,x′ )=5, Leading to ρ(Y x , Y x′ )=5 / 6 and ρ m (Y x ,Y x′ )=5 / (√6-1·√6-1)=1.

[0086] In addition, Assumption 4 also guarantees the identifiability of θ, as shown in Proposition 3.

[0087] Proposition 3 Under Assumption 4: The conclusion in Proposition 1 also holds.

[0088] An innovative estimation method is described below. Assume that {(x i , z i ,y i ): i=1,...,N} is a sample consisting of N realizations of random variables (X, Z, Y). For an individual, given the evidence of the individual (X=x, Z=z, Y=y), estimate its counterfactual outcome y x′ , which is the Y for this individual x′ Implementation.

[0089] The counterfactual learning problem is formulated as the following two-level optimization problem: in is the check function, and the upper optimization is to estimate τ * , that is, the distribution The quantile of y in , and the underlying optimization is to estimate the conditional quantile function For a given τ. Then use q(x′, z; τ * ) Estimate y x′ .

[0090] To reveal the limitations of the above estimation method, let the following two equations be x and Y x′ The conditional quantile regression function of :

[0091] According to equation (4), y x′ can be expressed as q x′ (z; τ * ), where τ * yes The quantile of y in the distribution of The following Proposition 4 shows the rationale behind adopting the inspection function as the loss for estimating the conditional quantile.

[0092] Proposition 4 states: For any given x, as well as

[0093] There are several potential problems with the above estimation method. First, the above method only fits a single quantile regression model to q(X, Z; τ) to obtain q x (Z; τ) and q x′ (Z; τ) is an estimate. If the two conditional quantile functions q x (Z; τ) and q x′ If (Z; τ) are derived from different models, this method may produce inaccurate estimates. Second, the above method requires estimating a unique τ for each individual before estimating the counterfactual outcome. * Moreover, the upper-level optimization does not guarantee a convex problem, which may lead to instability in the two-level optimization process.

[0094] A simple improvement is to use the inverse propensity weighting method to estimate q x (z; τ) and q x′ (z; τ). For example, for q x (z; τ), the associated loss function is given by: in is the propensity score. Similarly, R x′ (f, τ) can be defined by replacing x with x′. x′ The estimation process of involves four steps. In step (1), the propensity score is estimated. In step (2), R is estimated by minimizing the range of candidate values ​​of τ. x (f, τ) to estimate q x (z; τ). In step (3), identification and distribution The candidate set of τ corresponding to the quantile of y in * In step (4), use q x′ (z; τ * ) Estimate y x′ , where by minimizing R x′ (f,τ * )Get q x′ (z; τ * ).

[0095] Although the four-step estimation method allows q x (Z; τ) and q x′(Z; τ) come from different models, but the method still requires estimating a different τ for each individual * And can be cumbersome.

[0096] Reference again Figure 3 In some embodiments, a first metric may be determined by comparing each observation in the first set of observations 320 with the target observation 310 of the target observation object 304. The first metric may indicate the rank preservation of different results. A second metric may be determined. The second metric may indicate the cumulative difference between the second set of observations 320 and the target observation 310 of the target observation object 304. Then, a prediction result 340 (denoted as R) may be derived based on the first metric and the second metric. x' ).

[0097] The first metric and the second metric may be used in any suitable manner to derive the prediction result 340. In some embodiments, a loss may be established with respect to the prediction result 340 based on the first metric and the second metric. The prediction result 340 may be optimized by minimizing the loss.

[0098] For example, to address this issue and further refine the estimation, an innovative loss function is proposed that directly obtains y for individuals with evidence (X = x, Z = z, Y = y) x′ The proposed ideal loss is constructed as where equation (12) is a function of t and for (X, Y x , Y x′ ) takes the expected operator. is an example of the first measure, and the term is an example of the second metric. The proposed estimation method is based on Theorem 1.

[0099] Theorem 1 states that the loss R x′ (t|x,z,y) is convex with respect to t and * is uniquely minimized at * is a solution that satisfies the following conditions:

[0100] Theorem 1 implies that, given evidence for an individual (X = x, Z = z, Y = y), under Assumption 4, the counterfactual outcome y x′ (y for this individual x′ y x′ = arg min t R x′(t|x,z,y). Importantly, the loss R x′ (t|x, z, y) does not estimate the SCM a priori nor constrain q x (z; τ) and q x′ (z;τ) are derived from the same model, and the loss does not require explicit estimation of different quantile values ​​for each individual.

[0101] In some embodiments, in response to an observation in the first set of observations 320 exceeding the target observation 310 of the target observation object 301, a positive effect may be assigned to the first metric. Alternatively or additionally, in response to a second observation in the first set of observations 320 being lower than the target observation 310 of the target observation object 304, a negative effect may be assigned to the first metric. For example, according to the term of equation (12) In the sign() function, if Y x exceeds y, the value of the sign() function is a predetermined positive value (such as 1), and if Y x Below y, the value of the sign() function is a predetermined negative value (such as -1).

[0102] In some embodiments, the observed features of the first and second groups of objects may be the same as the observed features of the target observed object 304. A first expectation for the first group of observations 320 may be derived based on the comparison results for each observation in the first group of observations 320. The first expectation may be determined as a first metric. A second expectation for the second group of observations 330 may be derived based on the corresponding differences between the second group of observations 330 and the target observations 310. The second expectation may be determined as a second metric. For example, the item is an example of an expectation for the first set of observations 320, and the term is an example of what is expected for the second set of observations 330 .

[0103] In some cases, due to the limited number of observation samples, it is difficult to obtain enough observation samples with the same observation characteristics as the target observation object. To this end, a smoothing mechanism can be applied so that observation samples with observation characteristics different from the observation characteristics of the target observation object can be used.

[0104] As an example, to optimize the ideal loss R x′ (t; x, z, y) needs to be estimated first. Specifically, a kernel smoothing based estimator is proposed for the ideal loss, which is given as where h is the bandwidth (smoothing) parameter, K h(u) = K(u / h) / h and K(·) is a symmetric kernel function that satisfies ∫K(u)du = 1 and ∫uK(u)dt = 1, such as the Epanechnikov kernel and Gaussian kernel Then we can directly minimize To estimate y x′ .

[0105] In some embodiments, for each first observation in the first set of observations 320, a first weight for the comparison result of the first observation and the target observation 310 may be applied based on a first observation feature of the first observation object corresponding to the first observation. A first metric is determined based on the corresponding weighted comparison result for the first set of observations 320. For example, the second term in equation (14) is an example of a first metric determined based on the corresponding weighted comparison result.

[0106] In some embodiments, the first weight may be determined based on a first score for the first observed feature and a difference between the first observed feature and the target observed feature of the target observed object 304. The first score may indicate a probability that an object having the first observed feature is assigned the first treatment. For example, z in the second term of equation (14) k -z is an example of a difference, and item p x (z k ) is an example of a first fraction.

[0107] Alternatively or additionally, in some embodiments, for each second observation in the second set of observations 330, a second weight of the difference between the second observation and the prediction 340 can be applied based on a second observation feature of the second observation object corresponding to the second observation. The second metric is determined based on the corresponding weighted differences for the second set of observations 330. For example, the first term in equation (14) is an example of a second metric determined based on the corresponding weighted differences for the second set of observations 330.

[0108] In some embodiments, the second weight may be determined based on a second score for the second observed feature and a difference between the second observed feature and the observed feature of the target object. The second score may indicate a probability that the object having the second observed feature is assigned the second treatment. For example, the term z in the first term of equation (14) k -z is an example of the difference between the second observed feature of the target object and the observed feature, and the term p x′ (z k ) is an example of a second fraction.

[0109] We now describe some analysis to demonstrate the effectiveness of the proposed smoothing mechanism. Proposition 5 states that if h→0 as N→∞, and the density function of Z is twice differentiable, then in Indicates the convergence of probability.

[0110] Proposition 5 indicates YesR x′ The asymptotically unbiased estimator of (t|x, z, y) proves the effectiveness of the estimator of the ideal loss.

[0111] In some embodiments, the target observation object may include each object assigned with the first treatment. A target model based on the observation data set and the prediction results for each observation object assigned with the first treatment may be generated. The target model may be used to determine a target treatment for the test object having the test feature from the first treatment and the second treatment.

[0112] According to an embodiment of the present disclosure, an innovative counterfactual learning method with a relaxed identifiability assumption and a theoretically guaranteed estimation method is proposed. On the one hand, for the identifiability assumption, an rank preservation assumption is introduced, indicating that the factual results and counterfactual results of an individual have the same rank in the corresponding distribution containing the factual results and counterfactual results for all individuals with the same characteristics. The identifiability of the counterfactual results under the proposed rank preservation assumption is proved, and the rank preservation assumption is shown to be strictly weaker than the monotonicity assumption. It is worth noting that this identifiability result holds even when the homogeneity assumption of the exogenous variables is violated.

[0113] On the other hand, a theoretically guaranteed method for unbiased estimation of counterfactual outcomes is further proposed. The proposed estimation method enjoys several desirable advantages. First, the method does not require a priori estimation of the SCM and therefore relies on fewer assumptions. Second, in contrast to the quantile regression method, this approach neither restricts the conditional quantile functions for different counterfactual outcomes to be derived from the same model, nor requires estimating different quantile values ​​for each individual. Third, the previous learning method is enhanced to adopt a convex loss for estimating counterfactual outcomes, which leads to a unique solution.

[0114] Figure 4 FIG. 4 is a flowchart of a process 400 for causal reasoning according to some embodiments of the present disclosure. The process 400 may be performed in Figure 1 is implemented at computer system 110 .

[0115] At box 410, the computer system 110 obtains an observation data set associated with multiple treatments and multiple observation objects, wherein the observation data set includes multiple observation samples, the observation samples correspond to observation objects among the multiple observation objects that are assigned treatments among the multiple treatments, and include observation features of the observation objects and observation results of the observation objects.

[0116] At block 420 , for a target observation among the plurality of observations, the computer system 110 determines from the observation data set a first set of observations of a first group of observations assigned a first treatment among the plurality of treatments, wherein the target observation is assigned the first treatment.

[0117] At block 430 , the computer system 110 determines, from the observation data set, a second set of observations that are assigned a second treatment that is different from the first treatment.

[0118] At block 440 , the computer system 110 generates a prediction result that the target observation is assigned a second treatment based on the first set of observations, the second set of observations, and the target observation of the target observation.

[0119] In some embodiments, the computer system 110 determines a first metric indicating the rank preservation of different results by comparing each observation in a first set of observations with a target observation of a target observation object; determines a second metric indicating the cumulative difference between a second set of observations and the target observation of the target observation object; and derives a predicted result based on the first metric and the second metric.

[0120] In some embodiments, the computer system 110 establishes a loss regarding the prediction result based on the first metric and the second metric; and optimizes the prediction result by minimizing the loss.

[0121] In some embodiments, in response to an observation in the first set of observations exceeding a target observation for a target observation, the computer system 110 assigns a positive effect to the first metric. Alternatively or additionally, in response to a second observation in the first set of observations being below the target observation for the target observation, the computer system 110 assigns a negative effect to the first metric.

[0122] In some embodiments, the observation characteristics of the first group of objects and the second group of objects are the same as the observation characteristics of the target observation object, and the computer system 110 derives a first expectation for the first group of observations as a first metric based on the comparison results for each observation in the first group of observations, and the computer system 110 derives a second expectation for the second group of observations as a second metric based on the corresponding differences between the second group of observations and the target observations.

[0123] In some embodiments, for each first observation in the first group of observations, the computer system 110 applies a first weight to a comparison result between the first observation and the target observation based on a first observation feature of a first observation object corresponding to the first observation; and determines a first metric based on the corresponding weighted comparison result for the first group of observations.

[0124] In some embodiments, the first weight is determined based on: a first score for the first observed feature, the first score indicating a probability that an object having the first observed feature is assigned the first treatment; and a difference between the first observed feature and a target observed feature of a target observed object.

[0125] In some embodiments, for each second observation in the second group of observations, the computer system 110 applies a second weight to the difference between the second observation and the predicted result based on a second observation feature of the second observation object corresponding to the second observation; and determines a second metric based on the corresponding weighted differences of the second group of observations.

[0126] In some embodiments, the second weight is determined based on: a second score for the second observed feature, the second score indicating a probability that an object having the second observed feature is assigned the second treatment; and a difference between the second observed feature and an observed feature of the target object.

[0127] In some embodiments, the target observed objects include each object assigned a first treatment, and the computer system 110 also generates a target model based on the observation data set and the prediction results for each observed object assigned the first treatment, wherein the target model is used to determine the target treatment for the test object having the test feature from the first treatment and the second treatment.

[0128] In some embodiments, one of the first treatment and the second treatment includes one of applying the specific medical treatment to the subject and not applying the specific medical treatment to the subject, and the other of the first treatment and the second treatment includes the other of applying the specific medical treatment to the subject and not applying the specific medical treatment to the subject.

[0129] Figure 5 FIG. 5 shows a block diagram of an apparatus 500 for counterfactual reasoning according to some embodiments of the present disclosure. For example, the apparatus 500 may be Figure 1 is implemented or included in the computer system 110 in Figure 1 The various modules / components in the apparatus 500 may be implemented by hardware, software, firmware or any combination thereof.

[0130] As shown in the figure, the device 500 includes a data set acquisition module 510, which is configured to acquire an observation data set associated with multiple treatments and multiple observation objects, wherein the observation data set includes multiple observation samples, the observation samples correspond to observation objects assigned with treatments among the multiple treatments, and include observation features of the observation object and observation results of the observation object.

[0131] The device 500 also includes a first result determination module 520, which is configured to determine, from an observation data set, a first group of observation results of a first group of observation objects assigned a first treatment among multiple treatments for a target observation object among multiple observation objects, wherein the target observation object is assigned a first treatment.

[0132] The apparatus 500 further comprises a second result determination module 530 configured to determine, from the observation data set, a second set of observation results of a second set of observation objects assigned with a second treatment, the second treatment being different from the first treatment.

[0133] The apparatus 500 further includes a prediction result generating module 540 configured to generate a prediction result that the target observation object is assigned with a second treatment based on the first group of observations, the second group of observations, and the target observations of the target observation object.

[0134] Apparatus 500 may also include corresponding modules configured to perform operations of process 400 and other embodiments as described herein.

[0135] Figure 6 1 shows a block diagram of an electronic device 600 in which one or more embodiments of the present disclosure may be implemented. It should be understood that Figure 6 The electronic device 600 shown is only an example and should not constitute any limitation on the functionality and scope of the embodiments described herein. The electronic device 600 can be used to implement, for example Figure 1 The electronic device 600 can also be used to implement Figure 5 Device 500.

[0136] like Figure 6As shown, the electronic device 600 is in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to, one or more processors or processing units 610, a memory 620, a storage device 630, one or more communication units 640, one or more input devices 650, and one or more output devices 660. The processing unit 610 may be an actual processor or a virtual processor, and may perform various processes according to a program stored in the memory 620. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capabilities of the electronic device 600.

[0137] The electronic device 600 typically includes various computer storage media. Such media can be any available media accessible to the electronic device 600, including but not limited to volatile media and non-volatile media, removable media and non-removable media. The memory 620 can be a volatile memory (e.g., a register, a cache, a random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory) or any combination thereof. The storage device 630 can be any removable medium or non-removable medium, and can include a machine-readable medium, such as a flash drive, a disk, or any other medium, which can be used to store information and / or data (such as training data for training) and can be accessed within the electronic device 600.

[0138] The electronic device 600 may also include additional removable / non-removable storage media, volatile / non-volatile storage media, and transient / non-transient storage media. Figure 6 620 is not shown, but a disk drive for reading from or writing to a removable, non-volatile disk (such as a "floppy disk"), and an optical drive for reading from or writing to a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) via one or more data media interfaces. The memory 620 may include a computer program product 625 having one or more program modules configured to perform various methods or actions of various embodiments of the present disclosure.

[0139] The communication unit 640 communicates with another computing device via a communication medium. In addition, the functions of the components in the electronic device 600 can be implemented by a single computing cluster or multiple computing machines that can communicate via a communication connection. Therefore, the electronic device 600 can operate in a networked environment using a logical connection to one or more other servers, a network personal computer (PC), or another network node.

[0140] The input device 650 may be one or more input devices, such as a mouse, a keyboard, a trackball, etc. The output device 660 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 600 may also communicate with one or more external devices (not shown) through the communication unit 640 as needed. External devices such as storage devices, display devices, etc. communicate with one or more devices that ensure that the user can interact with the electronic device 600, or communicate with any device (e.g., a network card, a modem, etc.) that enables the electronic device 600 to communicate with one or more other computing devices. Such communication may be performed via an input / output (I / O) interface (not shown).

[0141] According to an example embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer-executable instructions or a computer program are stored, wherein the computer-executable instructions or the computer program are executed by a processor to implement the above method. According to an example embodiment of the present disclosure, a computer program product is also provided. The computer program product is physically stored on a non-transitory computer-readable medium and includes computer-executable instructions, which are executed by a processor to implement the above method.

[0142] Various aspects of the present disclosure are described herein with reference to the flowchart and / or block diagram of the method, device, equipment and computer program product implemented according to the present disclosure. It should be understood that each frame of the flowchart and / or block diagram and the combination of each frame in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0143] These computer-readable program instructions can be provided to the processing unit of a general-purpose computer, a special-purpose computer or other programmable data processing device, to produce a machine that generates a device for implementing the function / action specified in one or more boxes in the flow chart and / or block diagram when these instructions are executed by the processing unit of a computer or other programmable data processing device. These computer-readable program instructions can also be stored in a computer-readable storage medium. These instructions ensure that computers, programmable data processing devices and / or other devices can work in a particular manner. Therefore, the computer-readable medium comprising instructions includes a product, and the product includes instructions for implementing the various aspects of the function / action specified in one or more boxes in the flow chart and / or block diagram.

[0144] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps can be executed on the computer, other programmable data processing apparatus, or other device to generate a computer-implemented process, so that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0145] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product implemented according to the present disclosure.In this respect, each frame in the flow chart or block diagram can represent a part of a module, a program segment or an instruction, which contains one or more executable instructions for implementing a specified logical function.In some alternative embodiments, the function marked in the frame can also occur in an order different from the function marked in the accompanying drawings.For example, depending on the function involved, two continuous frames can actually be executed in parallel, and sometimes can also be executed in reverse order.It should also be noted that each frame in the block diagram and / or the flow chart and the combination of the frames in the block diagram and / or the flow chart can be implemented by a special hardware-based system that performs a specified function or action, or implemented by a combination of special hardware and computer instructions.

[0146] Each embodiment of the present disclosure has been described above. The above description is exemplary rather than exhaustive and is limited by the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used in this article is intended to best explain the principles, practical applications or improvements of the technology in the market for each embodiment, or to ensure that other persons of ordinary skill in the art can understand the various embodiments disclosed herein.

Claims

1. A method of counterfactual reasoning, comprising: Acquire an observation data set associated with a plurality of treatments and a plurality of observation objects, wherein the observation data set includes a plurality of observation samples, the observation samples correspond to observation objects among the plurality of observation objects to which treatments among the plurality of treatments are assigned, and include observation features of the observation objects and observation results of the observation objects; For a target observation object among the multiple observation objects, Determining a first set of observations of a first set of observations assigned a first treatment of the plurality of treatments from the observation data set, wherein the target observation is assigned the first treatment; determining, from the observation data set, a second set of observations assigned a second treatment to a second set of observations, the second treatment being different from the first treatment; as well as Based on the first group of observations, the second group of observations, and the target observation of the target observation object, a prediction result that the target observation object is assigned the second treatment is generated.

2. The method according to claim 1, wherein generating a prediction result that the target observation object is assigned the second treatment comprises: determining a first metric indicative of rank preservation of different results by comparing each observation in the first set of observations to the target observation of the target observation object; determining a second metric indicative of a cumulative difference between the second set of observations and the target observation of the target observation; as well as The prediction result is obtained based on the first metric and the second metric.

3. The method according to claim 2, wherein deriving the prediction result based on the first metric and the second metric comprises: Establishing a loss for the prediction result based on the first metric and the second metric; as well as The prediction result is optimized by minimizing the loss.

4. The method of claim 2, wherein determining the first metric comprises at least one of: assigning a positive effect to the first metric in response to an observation in the first set of observations exceeding the target observation for the target observation object, or In response to a second observation in the first set of observations being lower than the target observation of the target observation object, a negative effect is assigned to the first metric.

5. The method according to claim 2, wherein the observation characteristics of the first group of objects and the second group of objects are the same as the observation characteristics of the target observation object, and Determining the first metric includes: Based on the comparison result for each observation in the first set of observations, a first expectation for the first set of observations is obtained as the first metric, and Wherein determining the second metric comprises: Based on the corresponding differences between the second set of observations and the target observations, a second expectation for the second set of observations is derived as the second metric.

6. The method of claim 2, wherein determining the first metric comprises: For each first observation result in the first group of observation results, applying a first weight to a comparison result between the first observation result and the target observation result based on a first observation feature of a first observation object corresponding to the first observation result; as well as The first metric is determined based on respective weighted comparison results for the first set of observations.

7. The method of claim 6, wherein the first weight is determined based on: a first score for the first observed characteristic, the first score indicating a probability that a subject having the first observed characteristic is assigned the first treatment; and The difference between the first observation feature and the target observation feature of the target observation object.

8. The method of claim 2, wherein determining the second metric comprises: For each second observation in the second set of observations, applying a second weight to a difference between the second observation and the predicted result based on a second observation feature of a second observation object corresponding to the second observation; as well as The second metric is determined based on respective weighted differences for the second set of observations.

9. The method of claim 8, wherein the second weight is determined based on: a second score for the second observed characteristic, the second score indicating a probability that a subject having the second observed characteristic is assigned the second treatment; and The difference between the second observed feature and the observed feature of the target object.

10. The method of claim 1, wherein the target observation object includes each object assigned with the first treatment, and the method further comprises: A target model is generated based on the observation data set and the prediction result for each observation object assigned with the first treatment, wherein the target model is used to determine a target treatment for a test object having a test feature from the first treatment and the second treatment.

11. The method of claim 1, wherein one of the first treatment and the second treatment comprises one of applying a specific medical treatment to the subject and not applying the specific medical treatment to the subject, and The other of the first treatment and the second treatment includes the other of applying a specific medical treatment to a subject and not applying the specific medical treatment to the subject.

12. An electronic device comprising a computer processor coupled to a computer readable memory unit, the memory unit comprising instructions that, when executed by the computer processor, implement a method for counterfactual reasoning, the method comprising: Acquire an observation data set associated with a plurality of treatments and a plurality of observation objects, wherein the observation data set includes a plurality of observation samples, the observation samples correspond to observation objects among the plurality of observation objects to which treatments among the plurality of treatments are assigned, and include observation features of the observation objects and observation results of the observation objects; For a target observation object among the multiple observation objects, Determining a first set of observations of a first set of observations assigned a first treatment of the plurality of treatments from the observation data set, wherein the target observation is assigned the first treatment; determining, from the observation data set, a second set of observations assigned a second treatment to a second set of observations, the second treatment being different from the first treatment; as well as Based on the first group of observations, the second group of observations, and the target observation of the target observation object, a prediction result that the target observation object is assigned the second treatment is generated.

13. The apparatus according to claim 12, wherein generating a prediction result that the target observation object is assigned the second treatment comprises: determining a first metric indicating rank preservation of different results by comparing each observation in the first set of observations to the target observation of the target observation object; determining a second metric indicative of a cumulative difference between the second set of observations and the target observation of the target observation; as well as The prediction result is obtained based on the first metric and the second metric.

14. The apparatus according to claim 13, wherein deriving the prediction result based on the first metric and the second metric comprises: Establishing a loss regarding the prediction result based on the first metric and the second metric; as well as The prediction result is optimized by minimizing the loss.

15. The apparatus of claim 13, wherein determining the first metric comprises at least one of: assigning a positive effect to the first metric in response to an observation in the first set of observations exceeding the target observation for the target observation object, or In response to a second observation in the first set of observations being lower than the target observation of the target observation object, a negative effect is assigned to the first metric.

16. The apparatus according to claim 13, wherein the observation characteristics of the first group of objects and the second group of objects are the same as the observation characteristics of the target observation object, and Determining the first metric includes: Based on the comparison result for each observation in the first set of observations, a first expectation for the first set of observations is obtained as the first metric, and Wherein determining the second metric comprises: Based on the corresponding differences between the second set of observations and the target observations, a second expectation for the second set of observations is derived as the second metric.

17. The apparatus of claim 13, wherein determining the first metric comprises: For each first observation result in the first group of observation results, applying a first weight to a comparison result between the first observation result and the target observation result based on a first observation feature of a first observation object corresponding to the first observation result; as well as The first metric is determined based on respective weighted comparison results for the first set of observations.

18. The apparatus of claim 13, wherein determining the second metric comprises: For each second observation in the second set of observations, applying a second weight to a difference between the second observation and the predicted result based on a second observation feature of a second observation object corresponding to the second observation; as well as The second metric is determined based on respective weighted differences for the second set of observations.

19. The apparatus of claim 12, wherein the target observation object comprises each object assigned with the first treatment, and the method further comprises: A target model is generated based on the observation data set and the prediction result of each observation subject assigned with the first treatment, wherein the target model is used to determine a target treatment for a test subject having a test feature from the first treatment and the second treatment.

20. A computer-readable storage medium having a computer program stored thereon, the computer program, when executed by an electronic device, causing the device to perform a method for counterfactual reasoning, the method comprising: Obtaining an observation data set associated with a plurality of treatments and a plurality of observation objects, wherein the observation data set includes a plurality of observation samples, the observation samples correspond to observation objects among the plurality of observation objects to which treatments among the plurality of treatments are assigned, and include observation features of the observation objects and observation results of the observation objects; For a target observation object among the multiple observation objects, Determining a first set of observations of a first set of observations assigned a first treatment of the plurality of treatments from the observation data set, wherein the target observation is assigned the first treatment; determining, from the observation data set, a second set of observations assigned a second treatment to a second set of observations, the second treatment being different from the first treatment; as well as Based on the first group of observations, the second group of observations, and the target observation of the target observation object, a prediction result that the target observation object is assigned the second treatment is generated.