Method and apparatus for training a causal tree, method and apparatus for predicting using a causal tree
By combining data before and after intervention to train a causal tree, and using loss calculations before and after intervention to ensure parallelism between the experimental and control groups, the problem of insufficient training effect of causal trees in existing technologies is solved, and more accurate causal effect estimation and customer complaint prediction are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
- Filing Date
- 2023-07-20
- Publication Date
- 2026-07-10
AI Technical Summary
Existing causal tree training methods mainly rely on post-intervention data, resulting in insufficient training effects and an inability to effectively estimate causal effects.
The causal tree was trained using data from both pre- and post-intervention subjects. By calculating the loss of nodes before and after the intervention, the parallelism between the experimental and control groups was ensured. Node splitting was performed under the condition of minimum loss until the splitting cessation condition was met.
This improves the training effect of causal trees, ensuring that causal effects can be estimated more accurately when applying causal trees, especially in customer complaint prediction in financial scenarios.
Smart Images

Figure CN116933079B_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of artificial intelligence technology, specifically to methods and apparatus for training causal trees, and methods and apparatus for using causal trees for prediction. Background Technology
[0002] Causal trees are a widely used tree model in machine learning. They are used to estimate conditional causal effects. Unlike other tree models, causal trees estimate causal effects in subspaces by segmenting the feature space. Current training methods for causal trees utilize data from intervened objects to train the causal tree. Summary of the Invention
[0003] In view of the above, embodiments of this specification provide methods and apparatus for training causal trees, and methods and apparatus for prediction using causal trees. Through these embodiments, causal trees can be trained simultaneously using object data before and after intervention, thereby improving the training effect of causal trees.
[0004] According to one aspect of the embodiments of this specification, a method for training a causal tree is provided, comprising: acquiring object data grouped according to experimental groups and control groups, wherein each object data includes splitting features and actual results obtained at each time step, the time step including multiple pre-intervention time steps and post-intervention time steps; splitting each node in the causal tree in the following manner until a splitting stopping condition is met: for each node in the causal tree, calculating the loss corresponding to the node as the current node under each splitting condition in the following manner: when the experimental group and control group in the current node are split into multiple sub-nodes according to the current splitting condition, calculating the sub-experimental group and sub-control group in each sub-node based on the actual results of each object data at each time step. The control group's prediction results at each time point are calculated. Based on the prediction results and actual results at each time point before intervention, the pre-intervention loss for each sub-node before intervention is calculated, where the pre-intervention loss for each sub-node is used to characterize the parallelism between the sub-experimental group and the sub-control group in that sub-node. Based on the pre-intervention loss and post-intervention loss for each sub-node, the loss of the current node under the current splitting condition is calculated, where the post-intervention loss for each sub-node is obtained based on the actual result and prediction result at the time point after intervention in that sub-node. After obtaining the loss of the current node under each splitting condition, the current node is split according to the splitting condition with the minimum loss to obtain the corresponding sub-nodes.
[0005] According to another aspect of the embodiments of this specification, a method for training a causal tree is also provided, comprising: acquiring user data grouped into experimental and control groups from a financial trading platform, wherein intervention operations are implemented for users in the experimental group, and no intervention operations are implemented for users in the control group, the intervention operations including at least one of increasing the user's transaction limit, decreasing the user's transaction limit, and removing the user from the financial trading platform, each user data including user splitting characteristics and whether a customer complaint is received at each time point, the time points including multiple pre-intervention time points and post-intervention time points; splitting each node in the causal tree in the following manner until the splitting stopping condition is met: for each node in the causal tree, calculating the loss corresponding to the node as the current node under each splitting condition in the following manner: the experimental group and the control group in the current node are split in the following manner... When splitting into multiple sub-nodes under the splitting condition, based on the actual customer complaint results corresponding to each user data at each time point, the predicted customer complaint results for the sub-experimental group and sub-control group in each sub-node at each time point are calculated respectively. Based on the predicted and actual customer complaint results at each time point before intervention, the pre-intervention loss for each sub-node before intervention is calculated, where the pre-intervention loss for each sub-node is used to characterize the parallelism between the sub-experimental group and sub-control group in that sub-node. Based on the pre-intervention loss and post-intervention loss for each sub-node, the loss of the current node under the current splitting condition is calculated, where the post-intervention loss for each sub-node is obtained based on the actual and predicted customer complaint results for that sub-node at the time point after intervention. After obtaining the loss of the current node under each splitting condition, the current node is split according to the splitting condition with the minimum loss to obtain the corresponding sub-nodes.
[0006] According to another aspect of the embodiments of this specification, a method for prediction using a causal tree is also provided, wherein the causal tree is trained according to at least one training method of this specification, and each leaf node of the causal tree includes: a first prediction result corresponding to the sub-experimental group, a second prediction result corresponding to the sub-control group, and the mean distance between the sub-experimental group and the sub-control group at the time of intervention. The method includes: inputting the data to be predicted into the causal tree; processing the data to be predicted sequentially using each node on the causal tree in order from the root node to the leaf node to determine the leaf node to which the data to be predicted belongs; and estimating the causal effect of the data to be predicted based on the first prediction result, the second prediction result, and the mean distance in the determined leaf node.
[0007] According to another aspect of the embodiments of this specification, a data acquisition unit is also provided to acquire object data grouped according to experimental groups and control groups, wherein each object data includes splitting features and actual results obtained at each time point, wherein each time point includes multiple pre-intervention time points and post-intervention time points; a prediction result calculation unit, when the experimental group and control group in the current node are split into multiple sub-nodes according to the current splitting conditions, calculates the prediction results of the sub-experimental group and sub-control group in each sub-node at each time point according to the actual results of each object data at each time point; and a pre-intervention loss calculation unit, calculates the pre-intervention loss corresponding to each sub-node before intervention based on the prediction results and actual results at each pre-intervention time point. In this context, the pre-intervention loss corresponding to each sub-node is used to characterize the parallelism between the sub-experimental group and the sub-control group within that sub-node; the conditional loss calculation unit calculates the loss of the current node under the current splitting condition based on the pre-intervention loss and post-intervention loss corresponding to each sub-node, wherein the post-intervention loss corresponding to each sub-node is obtained based on the actual result and the predicted result corresponding to that sub-node at the post-intervention time; after obtaining the loss corresponding to the current node under each splitting condition, a node splitting unit is triggered; and the node splitting unit performs splitting processing on the current node according to the splitting condition with the minimum loss to obtain the corresponding sub-nodes; wherein, each node in the causal tree is split until the splitting stop condition is met.
[0008] According to another aspect of the embodiments of this specification, an apparatus for prediction using a causal tree is also provided, wherein the causal tree is trained according to at least one method of this specification, and each leaf node of the causal tree includes: a first prediction result corresponding to the sub-experimental group, a second prediction result corresponding to the sub-control group, and the mean distance between the sub-experimental group and the sub-control group at the time of intervention. The apparatus includes: an input unit for inputting the data to be predicted into the causal tree; a causal tree modeling unit for processing the data to be predicted sequentially using each node on the causal tree in order from the root node to the leaf node to determine the leaf node to which the data to be predicted belongs; and a causal effect estimation unit for estimating the causal effect of the data to be predicted based on the first prediction result, the second prediction result, and the mean distance in the determined leaf node.
[0009] According to another aspect of the embodiments of this specification, an electronic device is also provided, comprising: at least one processor, a memory coupled to the at least one processor, and a computer program stored on the memory, wherein the at least one processor executes the computer program to implement the method of training a causal tree and the method of prediction using the causal tree as described above. Attached Figure Description
[0010] A further understanding of the nature and advantages of the embodiments described in this specification can be achieved by referring to the following accompanying drawings. In the drawings, similar components or features may have the same reference numerals.
[0011] Figure 1 A flowchart illustrating an example of a method for training a causal tree according to embodiments of this specification is shown.
[0012] Figure 2 A flowchart illustrating an example of calculating pre-intervention loss according to embodiments of this specification is shown.
[0013] Figure 3 A flowchart illustrating an example of a method for prediction using a causal tree according to an embodiment of this specification is shown.
[0014] Figure 4 A block diagram of an example of a causal tree training apparatus according to an embodiment of this specification is shown.
[0015] Figure 5 A block diagram of an example of a causal tree prediction apparatus according to an embodiment of this specification is shown.
[0016] Figure 6 A block diagram of an electronic device for implementing a causal tree training method according to an embodiment of this specification is shown.
[0017] Figure 7 A block diagram illustrating an embodiment of this specification is shown for implementing an electronic device using a causal tree prediction method. Detailed Implementation
[0018] The subject matter described herein will be discussed below with reference to exemplary embodiments. It should be understood that these embodiments are discussed merely to enable those skilled in the art to better understand and implement the subject matter described herein, and are not intended to limit the scope, applicability, or examples set forth in the claims. The function and arrangement of the elements discussed may be changed without departing from the scope of the embodiments described herein. Various processes or components may be omitted, substituted, or added as needed in the various examples. Furthermore, features described in some examples may be combined in other examples.
[0019] As used herein, the term "comprising" and its variations are open terms meaning "including but not limited to". The term "based on" means "at least partially based on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other definitions, whether explicit or implicit, may be included below. Unless explicitly indicated by the context, the definition of a term shall remain consistent throughout the specification.
[0020] Causal trees are a widely used tree model in machine learning. They are used to estimate conditional causal effects. Unlike other tree models, causal trees estimate causal effects in subspaces by segmenting the feature space. Current training methods for causal trees utilize data from intervened objects to train the tree. A better training method for causal trees is urgently needed.
[0021] In view of the above, embodiments of this specification provide a method and apparatus for training a causal tree, and a method and apparatus for prediction using a causal tree. In the training method, object data grouped into experimental and control groups is acquired; each node in the causal tree is split in the following manner until a splitting stopping condition is met: for each node in the causal tree, the loss corresponding to that node as the current node under each splitting condition is calculated in the following manner: when the experimental and control groups in the current node are split into multiple child nodes according to the current splitting condition, the prediction results of the sub-experimental groups and sub-control groups in each child node are calculated at each time step based on the actual results of each object data at each time step; the pre-intervention loss corresponding to each child node before intervention is calculated based on the prediction results and actual results at each time step before intervention; the loss of the current node under the current splitting condition is calculated based on the pre-intervention loss and post-intervention loss corresponding to each child node; and after obtaining the loss corresponding to the current node under each splitting condition, the current node is split according to the splitting condition with the minimum loss to obtain the corresponding child nodes. Through the embodiments of this specification, the causal tree is trained using both pre-intervention and post-intervention object data, improving the training effect of the causal tree.
[0022] The following describes in detail, with reference to the accompanying drawings, the method and apparatus for training causal trees, and the method and apparatus for prediction using causal trees, as provided in the embodiments of this specification.
[0023] The causal tree in the embodiments of this specification can be applied to different application scenarios, such as drug trials and financial scenarios. The following explanation uses the customer complaint application scenario in the financial sector as an example. A customer complaint is a complaint from a customer, and the customer complaint rate is the rate of change in the number of customer complaints.
[0024] Based on the characteristics of estimating causal effects using causal trees, two groups can be included for comparison: an experimental group and a control group. These two groups can receive different interventions. For example, one group receives an intervention, while the other does not. Each group can include data from several subjects.
[0025] The object data used to train the causal tree is object-specific data, where objects can exhibit different states over time or in response to changing circumstances. Changes in an object can be caused by implemented interventions or other factors, such as weather. The state changes represented by the object data can involve interventions (treatments), which alter the object's state. This state can be represented by the resulting outcome. Furthermore, the actual change in the outcome caused by the implemented intervention can be considered a causal effect.
[0026] Taking customer complaint application scenarios as an example, the target can include users involved in financial business. The target data can be user data, such as user data corresponding to users on a financial trading platform. User data can include user characteristic data, user operation data, and transaction data on the financial trading platform. Intervention operations can include credit limit increases, credit limit decreases, and account termination for users. The results can include whether a customer complaint is filed, and the causal effect can be the change in the customer complaint rate.
[0027] Figure 1 A flowchart illustrating an example of a method for training a causal tree according to embodiments of this specification is shown.
[0028] like Figure 1 As shown, at 110, object data can be retrieved.
[0029] In the embodiments of this specification, the acquired object data can be grouped into experimental and control groups. In one example, the experimental group may be the group that receives the intervention, and the control group may be the group that does not receive the intervention.
[0030] Each object data set may include the splitting features of the object represented by that object data set and the actual results obtained at different times. The splitting features may include factors affecting the object's state outcome; for example, splitting features may include at least one of the object's age, occupation, asset status, online duration, etc. The actual results in each object data set may be the object's actual state outcome. For each object, multiple actual results can be collected at different times. The times corresponding to each actual result in the object data set may include multiple pre-intervention times and post-intervention times. Pre-intervention times may include all times before real-time intervention for any group (including the experimental group and the control group), and post-intervention times may include at least one time after real-time intervention for any group (including the experimental group and the control group). In one example, in a customer complaint application scenario, the actual result may be the actual result of whether or not a customer complaint was filed, including results with and without customer complaints.
[0031] In one example, each object's data may also include intervention methods, which can include intervention operations and non-intervention operations. That is, if an intervention operation can be performed on an object, then the intervention method included in that object's object data is an intervention operation; when no intervention is performed on an object, then the intervention method included in that object's object data is a non-intervention operation. In one example, intervention methods can be represented by two different identifiers, such as 0 and 1, where 1 represents an intervention operation and 0 represents a non-intervention operation. In one example, if an intervention operation can be performed on objects in the experimental group and no intervention is performed on objects in the control group, then the intervention method in each object's data in the experimental group is an intervention operation, and the intervention method in each object's data in the control group is a non-intervention operation.
[0032] In one example, object data can be in the form of triples, where the elements of the triples include the splitting feature, the actual outcome, and the intervention method.
[0033] In the embodiments of this specification, the object data may differ in different application scenarios. In one example, in a customer complaint application scenario, the object represented by the object data may include users involved in financial business, thus the object data may be user data. The user data may include corresponding segmentation characteristics and the actual results of whether a user has filed a customer complaint at different times. In addition, the user data may also include intervention methods for users.
[0034] In one example, within a financial scenario involving customer complaints, intervention actions can lead to user complaints. These intervention actions can include at least one of the following: increasing credit limits, decreasing credit limits, or removing the user from the platform or system. Increasing credit limits raises a user's withdrawal or spending limit, decreasing credit limits lowers a user's withdrawal or spending limit, and removing a user from the platform or system prevents them from accessing the corresponding services. For example, removing a user from a loan platform means that user can no longer access loan services on that platform.
[0035] In step 120, for the current node of the causal tree, the current node can be split into multiple child nodes according to the current splitting conditions.
[0036] In the embodiments described in this specification, the causal tree consists of several nodes. Except for the root node, each node is obtained by splitting from its corresponding parent node. The parent node can be split into multiple child nodes according to splitting conditions. All nodes in the causal tree except for leaf nodes can serve as parent nodes. Each node corresponds to a space composed of object data. When a node splits, its corresponding space is also split into several subspaces, with each child node corresponding to one subspace. The object data included in the space corresponding to each node conforms to the characteristic requirements of that node.
[0037] In the causal tree, all nodes except the leaf nodes can be split according to the operations of 120 to 170 in the embodiments of this specification. Each time (or in one loop), one node can be processed, and that node can be the current node.
[0038] Each node can correspond to multiple potential splitting conditions, and each splitting condition corresponds to a splitting method. Each splitting condition can be composed of features and thresholds used as the basis for splitting; different features and / or different thresholds can constitute different splitting conditions. The features in the splitting conditions can include at least one feature from the object data. In customer complaint application scenarios, the features in the splitting conditions include factors that affect the outcome of the customer complaint, such as the frequency of the user's use of the financial trading platform and the online time on the financial trading platform.
[0039] For the current node, one of the corresponding splitting conditions can be selected as the current splitting condition each time, and the loss of the current node under the current splitting condition can be calculated. By traversing each splitting condition of the current node, the loss corresponding to each splitting condition can be obtained.
[0040] In the embodiments of this specification, each node can be split into multiple child nodes according to each splitting condition. In one example, each node can be split into two child nodes. The following description uses two child nodes as an example. In one splitting method, when splitting the current node, object data with splitting characteristics greater than or equal to a threshold can be divided into one subspace, and object data with splitting characteristics less than the threshold can be divided into another subspace. Each subspace corresponds to one child node. In one example, when each node is split into left and right nodes, object data with splitting characteristics greater than or equal to the threshold can be divided into the right node, and object data with splitting characteristics less than the threshold can be divided into the left node.
[0041] In the embodiments described in this specification, the space corresponding to the current node includes an experimental group and a control group. The subspace corresponding to each child node obtained after splitting also includes an experimental group and a control group. The experimental group and control group in the child node can be referred to as the sub-experimental group and the sub-control group. The sub-experimental group in the child node is a subset of the experimental group in the current node, and the sub-control group in the child node is a subset of the control group in the current node.
[0042] In step 130, based on the actual results of each object's data at each time point, the predicted results of the sub-experimental group and sub-control group in each sub-node can be calculated at each time point.
[0043] For each group (including sub-experimental group and sub-control group) within each sub-node, the predicted result for that group at that specific moment can be calculated based on the actual results included in the object data of that group at the same time. In one example, in a customer complaint application scenario, the predicted result could be the prediction of whether a customer complaint has occurred. In another example, to calculate the predicted result at a target time, the actual results included in the object data of each group at the target time can be determined, and then the average of these determined actual results can be calculated. The resulting average can be used as the predicted result for that group at the target time.
[0044] For example, for a sub-experimental group in a child node labeled l, the prediction result of that sub-experimental group at time t can be calculated according to the following formula:
[0045]
[0046] in, T represents the prediction result of the sub-experimental group (1 represents the sub-experimental group) in child node l at time t. l T represents the set of object data included in the sub-experiment group within child node l. l It can be a set of identifiers for object data in a sub-experimental group, |T l | indicates the number of object data included in the sub-experiment group within child node l. This represents the actual result of the i-th object data at time t. Child node l can be the left child node split from the current node, and correspondingly, child node r can be the right child node split from the current node.
[0047] For a sub-experimental group in child node r, the prediction result of the sub-experimental group at time t can be calculated according to the following formula:
[0048]
[0049] in, T represents the prediction result of the sub-experimental group in child node r at time t. r T represents the set of object data included in the sub-experiment group within child node r. r It can be a set of identifiers for object data in a sub-experimental group, |T r | Indicates the number of object data included in the sub-experiment group within the child node r.
[0050] For example, for the sub-control group in child node l, the prediction result of the sub-control group at time t can be calculated according to the following formula:
[0051]
[0052] in, C represents the prediction result of the sub-control group (0 represents the control group) in child node l at time t. l C represents the set of object data included in the sub-control group within child node l. l It can be a set of identifiers for object data in a sub-control group, |C l | indicates the number of object data included in the sub-control group within child node l.
[0053] For the sub-control group in child node r, the prediction result of the sub-control group at time t can be calculated according to the following formula:
[0054]
[0055] in, C represents the prediction result of the sub-control group (0 represents the control group) in child node r at time t. r C represents the set of object data included in the sub-control group within child node r. r It can be a set of identifiers for object data in a sub-control group, |C r | indicates the number of object data included in the sub-control group within the child node r.
[0056] In step 140, the pre-intervention loss corresponding to each sub-node before the intervention can be calculated based on the predicted and actual results at each time point before the intervention.
[0057] In the embodiments of this specification, the pre-intervention loss corresponding to each sub-node can be used to characterize the parallelism between the sub-experimental group and the sub-control group within that sub-node. When the experimental group and the control group are parallel, this serves as a prerequisite for difference-in-differences (DID) calculations, thereby enabling the use of DID to estimate causal effects.
[0058] In one example, the pre-intervention loss for each sub-node can be calculated based on the predicted results for the sub-experimental and sub-control groups at each pre-intervention time point and the actual results for each object.
[0059] In this example, "before intervention" refers to the time period prior to the real-time intervention. Each sub-node can calculate its corresponding pre-intervention loss. For each sub-node, the pre-intervention loss can be calculated as a parallel loss, based on the predicted results of the sub-experimental group and sub-control group within that sub-node at each pre-intervention time point, and the actual results of the data for each object within that sub-node. The parallel loss can be used to measure the parallelism between the sub-experimental group and sub-control group within the same sub-node.
[0060] In one example, parallelism loss can be represented by variance, which can be used to represent the difference between each variable and the population mean, and thus can be used to measure the parallelism between sub-experimental groups and sub-control groups within the same sub-node.
[0061] Figure 2 A flowchart illustrating an example of calculating pre-intervention loss according to embodiments of this specification is shown.
[0062] like Figure 2 As shown in 141, for each sub-node, the mean interval between the sub-experimental group and the sub-control group can be obtained based on the actual results of the sub-experimental group and the sub-control group at each time point before intervention.
[0063] Each subject data set includes actual results at various time points (including pre-intervention and post-intervention time points). In one example, for each pre-intervention time point, the mean of the actual results for the sub-group at that pre-intervention time point can be obtained based on the actual results corresponding to that pre-intervention time point in the subject data sets of each subject group within the sub-experimental group. Correspondingly, the mean of the actual results for the sub-control group at that pre-intervention time point can be obtained based on the actual results corresponding to that pre-intervention time point in the subject data sets of each subject group within the sub-control group. Then, the difference between the mean of the sub-experimental group's actual results at that pre-intervention time point and the mean of the sub-control group's actual results is calculated to obtain the time-mean interval at that pre-intervention time point. This time-mean interval can be used to represent the distance between the sub-experimental group and the sub-control group at that pre-intervention time point.
[0064] After obtaining the mean time intervals corresponding to each time point before intervention, the mean time intervals corresponding to each time point before intervention can be averaged to obtain the mean interval in the targeted sub-node. This mean interval can be used to represent the interval between the sub-experimental group and the sub-control group in the time period before the intervention operation.
[0065] In one example, the mean spacing among child nodes can be calculated using the following formula:
[0066]
[0067] Where j represents the j-th child node, c j Y represents the mean interval of child node j, T represents the time after intervention, 1, 2, ..., T-1 represent the time before intervention, i represents the corresponding object data, and Y represents the mean interval of child node j. i,t T represents the actual result of object data i at time t. j C represents the set of object data included in the sub-experiment group within child node j. j This represents the set of object data included in the sub-control group of child node j.
[0068] In 143, the individual distance of each object in the target sub-node at each time before intervention can be calculated based on the actual results of each object data in the target sub-node at each time before intervention, and the predicted results of the sub-experimental group and sub-control group in the sub-node at each time before intervention.
[0069] In one example, for each object data point in the sub-node at each pre-intervention time, the individual spacing of the object data at the pre-intervention time can be obtained based on the actual result of the object data at the pre-intervention time and the predicted result of another subgroup relative to the subgroup to which the object data belongs at the pre-intervention time. This spacing represents the distance between the sub-experimental group and the sub-control group.
[0070] In this example, when the target data belongs to a subgroup that is a sub-experimental group, the corresponding subgroup is a sub-control group; when the target data belongs to a subgroup that is a sub-control group, the corresponding subgroup is a sub-experimental group.
[0071] In one example, for each object data point at each pre-intervention time, the predicted result of another subgroup relative to the subgroup to which the object data belongs at the pre-intervention time can be calculated as the difference between the actual result of the object data at the pre-intervention time, and the resulting difference can be used as the individual interval of the object data at the pre-intervention time.
[0072] In one example, the individual spacing for each object at each time point before the intervention can be obtained using the following formula:
[0073]
[0074] Where, x i This represents the target data, Δ(x) i ,t) represents object data x i The individual distance w at time t before intervention i Represents object data x i The intervention method, when implementing the intervention operation, w i The value is 1, when no intervention is performed, w i It is 0. This represents an exponential function. It returns 1 if the expression within the square brackets is true, and 0 otherwise. For the part following the summation symbol, it returns 1 only if w and w i The value is true when it is the opposite of the given value, and true when it is 1. With object data x i The predicted outcome of the corresponding subgroup at time t before intervention. i,t Represents object data x i The actual result at time t before intervention.
[0075] In 145, the pre-intervention loss for the corresponding sub-node can be calculated in the form of parallel loss, based on the mean interval and the individual intervals of the data of each object in the targeted sub-node at each time point before the intervention.
[0076] In one example, when parallel loss is calculated as variance, the mean interval can be used as the population mean in the variance, and the individual interval can be used as each variable in the variance.
[0077] In one example, the pre-intervention loss can be calculated using the following formula:
[0078]
[0079] Among them, R j Let Q represent the pre-intervention loss of child node j before intervention, T represent the post-intervention time, and 1, 2, ..., T-1 represent the respective pre-intervention times. j This represents the collection of object data in child node j.
[0080] By introducing a pre-intervention loss to characterize the parallelism between the experimental and control groups in each node, the parallelism between the experimental and control groups is taken as one of the factors to consider in the training effect during the training of the causal tree. This allows each node in the causal tree to consider the parallelism between the experimental and control groups during the splitting process, thereby improving the parallelism between the sub-experimental and sub-control groups in the resulting sub-nodes. This ensures that the prerequisite for using the difference-in-differences algorithm (i.e., the parallelism between the experimental and control groups) is met when applying the causal tree.
[0081] Compared to the approach that assumes preconditions for the difference-in-differences algorithm, the embodiments in this specification split nodes by considering the parallelism between the experimental group and the control group as one of the factors. This ensures that the parallelism between the sub-experimental group and the sub-control group in each of the split sub-nodes is high, thereby ensuring the preconditions for using the difference-in-differences algorithm. As a result, when applying the causal tree, the difference-in-differences algorithm can be used for prediction based on the established preconditions, which can improve the prediction effect of the causal tree.
[0082] At 150, based on the pre-intervention loss and post-intervention loss of each child node, the loss of the current node under the current splitting condition can be calculated.
[0083] In the embodiments of this specification, the post-intervention loss corresponding to each sub-node can be obtained from the actual result and the predicted result corresponding to the sub-node at the post-intervention time.
[0084] In one example, before performing operation 150, the operation of calculating the post-intervention loss can be performed first. That is, based on the actual and predicted results of the multiple child nodes split from the targeted node according to the current splitting conditions at the time of intervention, the post-intervention loss for each child node can be calculated.
[0085] In this example, a loss function can be used to calculate the post-intervention loss for each child node. This loss function can be calculated using the squared difference method. In one example, the loss function can be used to calculate the squared difference between the actual result and the predicted result at the time point after the intervention, and the resulting value can be used as the post-intervention loss.
[0086] In one example, each child node can calculate its corresponding post-intervention loss. For each child node, the actual result of each object's data at the post-intervention time can be determined, as well as the predicted result of the sub-experimental group or sub-control group to which each object's data belongs at the post-intervention time.
[0087] For example, the predicted result of the sub-experimental group to which the object data in child node l belongs at time T after intervention is: The predicted result of the sub-control group to which the object data in child node l belongs at time T after intervention is: The predicted result of the sub-experimental group to which the object data in the other child node r belongs at time T after intervention is: The predicted result of the sub-control group to which the object data in child node r belongs at time T after intervention is:
[0088] After determining the actual and predicted results, the post-intervention loss corresponding to each sub-node can be calculated based on the correspondence between the actual results of each object's data and the predicted results of the sub-experimental group or sub-control group to which each object's data belongs.
[0089] For each data set, there are both the actual results and the predicted results for its corresponding group (including sub-experimental and sub-control groups). Therefore, the actual results and the predicted results for their respective groups can be considered as a single data set. In one example, the data set for each data set can be represented as follows: Among them, Y i,T w represents the actual result of object data i at time T after intervention. i Indicates the intervention method for object data i, which can be 0 or 1.
[0090] For each object data point, the actual results included in the object data and the predicted results corresponding to its group are substituted into a specified loss function for calculation to obtain the post-intervention loss for that object data. After calculating the post-intervention loss for each object data point in the targeted child node, the sum of the individual post-intervention losses can be determined as the post-intervention loss for that child node.
[0091] In one example, the loss after intervention of child node l can be obtained according to the following formula:
[0092]
[0093] in, Y represents the loss function. i,T and They were respectively substituted into the loss function The variable, Q l This represents the collection of object data in child node l.
[0094] In one example, when the current node is split into two child nodes l and r, the post-intervention loss of the other child node r can be obtained according to the following formula:
[0095]
[0096] Among them, Q r This represents the collection of object data in the child node r.
[0097] In the embodiments of this specification, after obtaining the pre-intervention loss and post-intervention loss corresponding to each child node, the total loss of each child node can be obtained based on the pre-intervention loss and post-intervention loss corresponding to that child node. In one example, the sum of the pre-intervention loss and post-intervention loss corresponding to the child node can be determined as the total loss of the child node. In another example, the pre-intervention loss can be multiplied by a specified weight, and then the sum of the pre-intervention loss multiplied by the specified weight and the post-intervention loss can be determined as the total loss of the child node. The calculation method of the total loss can be expressed by the following formula:
[0098] Loss l =L l +ρR l
[0099] Where, loss l ρ represents the total loss of child node l under the current splitting condition, and ρ represents the weight.
[0100] Correspondingly, the total loss of another child node r splitting from the same node can be calculated using the following formula:
[0101] Loss r =L r +ρR r
[0102] Among them, Loss r This represents the total loss of child node r under the current splitting conditions.
[0103] After obtaining the total loss for multiple child nodes split from the same node, the loss of the current node under the current split condition can be calculated based on the total loss of each child node. In one example, the sum of the total losses of each child node can be used as the loss of the current node under the current split condition. In one example, loss = loss l +loss r The loss represents the loss of the current node under the current splitting condition.
[0104] At step 160, determine whether the loss of the current node under each split condition has been obtained. If yes, proceed to step 170; otherwise, return to step 130.
[0105] If the loss of the current node under each split condition is not obtained, the split condition for which the loss has not been calculated can be used as the current split condition in the next loop, and the operation 130 can be returned.
[0106] In step 170, the current node can be split according to the splitting condition that minimizes loss to obtain the corresponding child nodes.
[0107] In one example, after obtaining the loss of the current node under each splitting condition, the losses can be compared to determine the splitting condition with the minimum loss. The current node is then split according to this determined condition. The more parallel the experimental and control groups are among the child nodes obtained by splitting according to the splitting condition with the minimum loss, the better.
[0108] At step 180, determine if the splitting stop condition is met. If not, proceed to step 190; otherwise, training ends, and the trained causal tree is obtained.
[0109] In one example, the splitting stopping condition includes at least one of the following: reaching a specified depth of the causal tree; the splitting feature and / or feature threshold as a splitting condition have been used; and the minimum loss of the parent node is less than the sum of the losses of the multiple child nodes split from the parent node, etc.
[0110] In this example, different splitting features and feature thresholds can be combined to obtain different splitting conditions. For the node to be split, each splitting condition can be traversed to determine the splitting condition with the minimum loss.
[0111] In step 190, the node to be split can be set as the current node in the next loop, and then the operation in step 130 can be executed.
[0112] In another embodiment of this specification, the provided causal tree training method can obtain user data grouped into experimental and control groups from a financial trading platform. Intervention operations are implemented for users in the experimental group, while no intervention operations are implemented for users in the control group. The intervention operations include at least one of the following: increasing the user's transaction limit, decreasing the user's transaction limit, or removing the user from the financial trading platform. Each user data point includes user segmentation characteristics and the actual result of whether a customer complaint was received at each time point. Each time point includes multiple pre-intervention times and post-intervention times.
[0113] When the experimental group and control group in the current node are split into multiple sub-nodes according to the current splitting conditions, the predicted results of whether or not a customer complaint is made for the sub-experimental group and sub-control group in each sub-node at each time are calculated based on the actual results of whether or not a customer complaint is made for each user data at each time.
[0114] Based on the predicted and actual customer complaint results at each pre-intervention time point, the pre-intervention loss for each sub-node is calculated. The pre-intervention loss for each sub-node is used to characterize the parallelism between the sub-experimental group and the sub-control group within that sub-node.
[0115] Calculate the loss of the current node under the current splitting conditions based on the pre-intervention loss and post-intervention loss of each child node. The post-intervention loss of each child node is obtained based on the actual and predicted customer complaint results at the post-intervention time for that child node.
[0116] Next, determine whether the loss of the current node under each splitting condition has been obtained. If not, return to perform the operation of calculating whether to accept the prediction result. If yes, the current node can be split according to the splitting condition with the minimum loss to obtain the corresponding child nodes.
[0117] Next, it checks if the splitting stopping condition is met. If yes, training ends, and the trained causal tree is obtained. If no, the node to be split can be used as the current node in the next loop, and then the process returns to calculate whether the prediction result is satisfactory.
[0118] In one example, when each user's data also includes an intervention method, the intervention operation in the intervention method can include at least one of the following: credit limit increase operation, credit limit decrease operation, and account termination operation.
[0119] Figure 3 A flowchart illustrating an example of a method for prediction using a causal tree according to an embodiment of this specification is shown.
[0120] The causal tree used can be obtained according to the causal tree training method provided in the embodiments of this specification. In the trained causal tree, each leaf node can include the first predicted result corresponding to the sub-experimental group, the second predicted result corresponding to the sub-control group, and the mean distance between the sub-experimental group and the sub-control group at the time after intervention.
[0121] like Figure 3 As shown in Figure 310, the data to be predicted can be input into the causal tree.
[0122] When the data to be predicted is input into the causal tree, the data is first input into the root node of the causal tree, and the root node processes the data to be predicted first.
[0123] In 320, each node on the causal tree processes the data to be predicted in sequence from the root node to the leaf node to determine the leaf node to which the data to be predicted belongs.
[0124] A causal tree is divided into multiple levels from top to bottom, with the root node at the top and the leaf nodes at the bottom. In a causal tree, one node at each level processes the data to be predicted, following the top-down order. In one processing method, each node is configured with a splitting condition to divide the data space. Each node determines the subspace to which the data to be predicted belongs based on the set splitting condition, and then passes the data to the corresponding child node in that subspace.
[0125] When the data to be predicted reaches the bottom layer of the causal tree, it can reach one of the leaf nodes, indicating that the data to be predicted belongs to the subspace corresponding to that leaf node.
[0126] In 330, the causal effect of the data to be predicted can be estimated based on the first prediction result, the second prediction result, and the mean interval in the determined leaf nodes.
[0127] In one example, the first prediction result, the second prediction result, and the mean interval in the determined leaf nodes can be calculated using a difference-in-differences approach to obtain the causal effect of the data to be predicted.
[0128] In one example, a difference calculation can be performed on the first and second prediction results in the determined leaf nodes to obtain a difference result. In this example, a difference calculation can be performed by subtracting the first and second prediction results, and the resulting difference is the difference result.
[0129] For example, a first-order difference calculation can be performed using the following formula:
[0130]
[0131] Where, j * This indicates the leaf node to which the data to be predicted belongs. This represents the result of a first-order difference. Represents leaf node j * The first predicted result for the sub-experimental group at the time of intervention. Represents leaf node j * The second predicted result corresponding to the control group at the time of intervention.
[0132] Then, a second difference calculation can be performed on the first difference result and the determined mean interval to obtain the causal effect of the data to be predicted. In this example, the second difference calculation can be performed by subtracting the first difference result from the mean interval, and the resulting difference is the causal effect.
[0133] For example, a first-order difference calculation can be performed using the following formula:
[0134]
[0135] in, Indicates causal effect, Represents leaf node j * The mean interval between the sub-experimental group and the sub-control group at the time of intervention.
[0136] By using the causal tree provided in the embodiments of this specification for prediction, the experimental group and the control group included in each leaf node are parallel. The prerequisite that the experimental group and the control group are parallel, which is required by the difference-in-differences calculation, has been met. Therefore, it is no longer necessary to assume that the experimental group and the control group are parallel, thereby improving the accuracy of the causal tree prediction results.
[0137] Figure 4 A block diagram of an example of a causal tree training apparatus 400 according to an embodiment of this specification is shown.
[0138] The causal tree training device 400 includes: a data acquisition unit 410, a prediction result calculation unit 420, a pre-intervention loss calculation unit 430, a conditional loss calculation unit 440, and a node splitting unit 450.
[0139] The data acquisition unit 410 can be configured to acquire object data grouped according to experimental and control groups, wherein each object data includes splitting characteristics and the actual results obtained at each time point, and each time point includes multiple pre-intervention time points and post-intervention time points.
[0140] The prediction result calculation unit 420 can be configured to calculate the prediction results of the sub-experimental group and sub-control group in each sub-node at each time step, based on the actual results of each object data at each time step, when the experimental group and control group in the current node are split into multiple sub-nodes according to the current splitting conditions.
[0141] The pre-intervention loss calculation unit 430 can be configured to calculate the pre-intervention loss corresponding to each sub-node before the intervention based on the predicted results and actual results at each pre-intervention time point. The pre-intervention loss corresponding to each sub-node is used to characterize the parallelism between the sub-experimental group and the sub-control group in that sub-node.
[0142] The conditional loss calculation unit 440 can be configured to calculate the loss of the current node under the current splitting condition based on the pre-intervention loss and post-intervention loss corresponding to each child node. The post-intervention loss corresponding to each child node is obtained based on the actual result and prediction result of the child node at the post-intervention time. After obtaining the loss of the current node under each splitting condition, the node splitting unit is triggered.
[0143] The node splitting unit 450 can be configured to split the current node according to the splitting condition that minimizes loss, in order to obtain the corresponding child nodes. Specifically, the splitting process is performed on each node in the causal tree until the splitting stopping condition is met.
[0144] In one example, the pre-intervention loss calculation unit 430 can also be configured to calculate the pre-intervention loss corresponding to each sub-node before the intervention, based on the predicted results of the sub-experimental group and sub-control group at each pre-intervention time and the actual results of each object data.
[0145] In one example, the pre-intervention loss calculation unit 430 can also be configured to: for each sub-node, calculate the pre-intervention loss corresponding to the sub-intervention node in the form of parallel loss, based on the predicted results of the sub-experimental group and sub-control group belonging to the sub-node at each pre-intervention time and the actual results of the data of each object in the sub-node.
[0146] In one example, the pre-intervention loss calculation unit 430 can also be configured to: for each sub-node, obtain the mean distance between the sub-experimental group and the sub-control group based on the actual results of the sub-experimental group and the sub-control group in the sub-node at each pre-intervention time; calculate the individual distance of the object data in the sub-node at each pre-intervention time based on the actual results of the object data in the sub-node at each pre-intervention time and the predicted results of the sub-experimental group and the sub-control group in the sub-node at each pre-intervention time; and calculate the pre-intervention loss corresponding to the sub-node before intervention in the form of parallel loss based on the mean distance and the individual distance of the object data in the sub-node at each pre-intervention time.
[0147] In one example, the causal tree training device may also include a post-intervention loss calculation unit, which can be configured to calculate the post-intervention loss for each child node based on the actual and predicted results at the post-intervention time points in multiple child nodes.
[0148] In one example, the post-intervention loss calculation unit can also be configured to: for each sub-node, determine the actual result of each object data in the sub-node at the time of intervention, and the predicted result of the sub-experimental group or sub-control group to which each object data belongs at the time of intervention; and calculate the post-intervention loss corresponding to the sub-node based on the correspondence between the determined actual result of each object data and the predicted result of the sub-experimental group or sub-control group to which each object data belongs.
[0149] In one example, the data acquisition unit 410 can also be configured to: acquire user data grouped into experimental and control groups from a financial trading platform, wherein intervention operations are implemented for users in the experimental group and no intervention operations are implemented for users in the control group. The intervention operations include at least one of the following: increasing the user's transaction financial limit, decreasing the user's transaction financial limit, and removing the user from the financial trading platform. Each user data includes splitting characteristics and the actual result of whether a customer complaint is received at each time point. Each time point includes multiple pre-intervention times and post-intervention times.
[0150] The prediction result calculation unit 420 can also be configured to: when the experimental group and control group in the current node are split into multiple sub-nodes according to the current splitting conditions, calculate the prediction result of whether the sub-experimental group and sub-control group in each sub-node are subject to customer complaint at each time according to the actual result of whether each user data is subject to customer complaint at each time.
[0151] The pre-intervention loss calculation unit can also be configured to: calculate the pre-intervention loss corresponding to each sub-node before the intervention, based on the predicted and actual results of customer complaints at each pre-intervention time point.
[0152] Figure 5 A block diagram of an example of a causal tree prediction device 500 according to an embodiment of this specification is shown.
[0153] Figure 5 The causal tree used in the example shown was trained according to at least one method provided in the embodiments of this specification. Each leaf node of the causal tree includes: a first prediction result corresponding to the sub-experimental group, a second prediction result corresponding to the sub-control group, and the mean interval between the sub-experimental group and the sub-control group at the time after intervention.
[0154] The causal tree prediction device 500 includes: an input unit 510, a causal tree model unit 520, and a causal effect estimation unit 530.
[0155] The input unit 510 can be configured to input the data to be predicted into the causal tree.
[0156] The causal tree model unit 520 can be configured to process the data to be predicted sequentially from the root node to the leaf node, so as to determine the leaf node to which the data to be predicted belongs.
[0157] The causal effect estimation unit 530 can be configured to estimate the causal effect of the data to be predicted based on the first prediction result, the second prediction result, and the mean interval in the determined leaf nodes.
[0158] In one example, the causal effect estimation unit 530 can also be configured to calculate the first prediction result, the second prediction result, and the mean interval in the determined leaf nodes using a double difference method to obtain the causal effect of the data to be predicted.
[0159] In one example, the causal effect estimation unit 530 can also be configured to: perform a difference calculation on the first and second prediction results in the determined leaf nodes to obtain a first difference result; and perform a second difference calculation on the first difference result and the determined mean interval to obtain the causal effect of the data to be predicted.
[0160] Reference above Figures 1 to 5 This specification describes embodiments of methods and apparatus for training causal trees and methods and apparatus for prediction using causal trees.
[0161] The apparatus for training causal trees and the apparatus for prediction using causal trees in the embodiments of this specification can be implemented in hardware, software, or a combination of hardware and software. Taking software implementation as an example, as a logically defined apparatus, it is formed by the processor of the device loading the corresponding computer program instructions from memory into memory and executing them. In the embodiments of this specification, the apparatus for training causal trees and the apparatus for prediction using causal trees can, for example, be implemented using electronic devices.
[0162] Figure 6 A block diagram of an electronic device 600 for implementing a causal tree training method according to an embodiment of this specification is shown.
[0163] like Figure 6 As shown, electronic device 600 may include at least one processor 610, memory (e.g., non-volatile memory) 620, RAM 630, and communication interface 640, and the at least one processor 610, memory 620, RAM 630, and communication interface 640 are connected together via bus 650. At least one processor 610 executes at least one computer-readable instruction (i.e., the elements implemented in software above) stored or encoded in memory.
[0164] In one embodiment, computer-executable instructions are stored in memory, which, when executed, cause at least one processor 610 to: acquire object data grouped according to experimental and control groups; split each node in a causal tree in such a manner as to satisfy a splitting stopping condition; for each node in the causal tree, calculate the loss corresponding to the node as the current node under each splitting condition in such a manner as: when the experimental and control groups in the current node are split into multiple child nodes according to the current splitting condition, calculate the predicted results corresponding to the sub-experimental groups and sub-control groups in each child node at each time step based on the actual results corresponding to each object data at each time step; calculate the pre-intervention loss corresponding to each child node before intervention based on the predicted results and actual results at each time step before intervention; calculate the loss of the current node under the current splitting condition based on the pre-intervention loss and post-intervention loss corresponding to each child node; and after obtaining the loss corresponding to the current node under each splitting condition, split the current node according to the splitting condition with the minimum loss to obtain the corresponding child nodes.
[0165] Figure 7 A block diagram of an electronic device 700 for implementing a causal tree prediction method according to an embodiment of this specification is shown.
[0166] like Figure 7 As shown, the electronic device 700 may include at least one processor 710, a memory (e.g., non-volatile memory) 720, a RAM 730, and a communication interface 740, and the at least one processor 710, memory 720, RAM 730, and communication interface 740 are connected together via a bus 750. The at least one processor 710 executes at least one computer-readable instruction (i.e., the elements implemented in software above) stored or encoded in the memory.
[0167] In one embodiment, computer-executable instructions are stored in memory that, when executed, cause at least one processor 710 to: input data to be predicted into a causal tree; process the data to be predicted sequentially from the root node to the leaf node to determine the leaf node to which the data to be predicted belongs; and estimate the causal effect of the data to be predicted based on a first prediction result, a second prediction result, and a mean interval in the determined leaf node.
[0168] It should be understood that the computer-executable instructions stored in the memory, when executed, cause at least one processor 610 and processor 710 to perform the above combinations as described in the various embodiments of this specification. Figure 1-5 The description includes various operations and functions.
[0169] According to one embodiment, a program product, such as a machine-readable medium, is provided. The machine-readable medium may have instructions (i.e., the elements implemented in software as described above), which, when executed by a machine, cause the machine to perform the above-described combinations of the various embodiments of this specification. Figure 1-5 The description includes various operations and functions.
[0170] Specifically, a system or apparatus equipped with a readable storage medium may be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer or processor of the system or apparatus can read and execute the instructions stored in the readable storage medium.
[0171] In this case, the program code itself, which can be read from a readable medium, can perform the functions of any of the above embodiments. Therefore, the machine-readable code and the readable storage medium storing the machine-readable code constitute a part of the present invention.
[0172] The computer program code required for the operation of each part of this manual can be written in any one or more programming languages, including object-oriented programming languages such as Java, Scala, Smalltalk, Eiffel, JADE, Emerald, C++, C#, VB, .NET, and Python; conventional procedural programming languages such as C, Visual Basic 2003, Perl, COBOL 2002, PHP, and ABAP; dynamic programming languages such as Python, Ruby, and Groovy; or other programming languages. This program code can run on the user's computer, or as a standalone software package on the user's computer, or partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer via any network, such as a local area network (LAN) or wide area network (WAN), or connected to an external computer (e.g., via the Internet), or in a cloud computing environment, or used as a service, such as Software as a Service (SaaS).
[0173] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer or the cloud via a communication network.
[0174] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0175] Not all steps and units in the above process and system structure diagrams are mandatory; some steps or units can be omitted as needed. The execution order of each step is not fixed and can be determined as required. The device structure described in the above embodiments can be a physical structure or a logical structure. That is, some units may be implemented by the same physical entity, or some units may be implemented by multiple physical entities, or they may be jointly implemented by certain components in multiple independent devices.
[0176] The term "exemplary" as used throughout this specification means "serving as an example, instance, or illustration" and does not imply that it is "preferred" or "advantageous" over other embodiments. Detailed descriptions are included for the purpose of providing an understanding of the described techniques. However, these techniques may be practiced without these detailed descriptions. In some instances, well-known structures and apparatuses are shown in block diagram form to avoid obscuring the concepts of the described embodiments.
[0177] The optional embodiments of the present specification have been described in detail above with reference to the accompanying drawings. However, the embodiments of the present specification are not limited to the specific details in the above embodiments. Within the scope of the technical concept of the embodiments of the present specification, various simple modifications can be made to the technical solutions of the embodiments of the present specification, and these simple modifications all fall within the protection scope of the embodiments of the present specification.
[0178] The foregoing description of this specification is provided to enable any person skilled in the art to implement or use the content of this specification. Various modifications to the content of this specification will be apparent to those skilled in the art, and the general principles defined herein can be applied to other variations without departing from the scope of protection of this specification. Therefore, this specification is not limited to the examples and designs described herein, but is consistent with the widest scope of the principles and novel features disclosed herein.
Claims
1. A method for training a causal tree, comprising: User data is obtained from a financial trading platform and grouped into experimental and control groups. Intervention operations are implemented for users in the experimental group, while no intervention operations are implemented for users in the control group. The intervention operations include at least one of the following: increasing the user's transaction limit, decreasing the user's transaction limit, and removing the user from the financial trading platform. Each user data includes user splitting characteristics and the actual result of whether a customer complaint was received at each time point. Each time point includes multiple pre-intervention times and post-intervention times. The nodes in the causal tree are split in the following manner until the splitting stops: For each node in the causal tree, the loss corresponding to that node as the current node under each splitting condition is calculated as follows, wherein each splitting condition includes user splitting features used as the basis for splitting and affecting whether a customer complaint result is obtained: When the experimental group and control group in the current node are split into multiple sub-nodes according to the current splitting conditions, the predicted results of whether or not a customer complaint is made for the sub-experimental group and sub-control group in each sub-node at each time are calculated based on the actual results of whether or not a customer complaint is made for each user data at each time. Based on the predicted and actual results of customer complaints at each pre-intervention time point, the pre-intervention loss corresponding to each sub-node is calculated. The pre-intervention loss corresponding to each sub-node is used to characterize the parallelism between the sub-experimental group and the sub-control group in that sub-node. Based on the pre-intervention loss and post-intervention loss corresponding to each sub-node, the loss of the current node under the current split condition is calculated, wherein the post-intervention loss corresponding to each sub-node is obtained based on the actual customer complaint result and the predicted customer complaint result at the post-intervention time for that sub-node; and After obtaining the loss of the current node under each of the splitting conditions, the current node is split according to the splitting condition with the minimum loss to obtain the corresponding child node.
2. The method as described in claim 1, wherein, Based on the predicted and actual customer complaint outcomes at each pre-intervention point, the pre-intervention losses for each sub-node are calculated, including: Based on the predicted customer complaint results for the sub-experimental group and the sub-control group at each time point before intervention, and the actual customer complaint results for each user data point, the pre-intervention loss for each sub-node before intervention is calculated.
3. The method as described in claim 2, wherein, Based on the predicted customer complaint results for the sub-experimental group and the sub-control group at each pre-intervention time point, and the actual customer complaint results for each user data point, the pre-intervention loss for each sub-node before intervention is calculated, including: For each sub-node, the pre-intervention loss corresponding to the sub-experimental group and sub-control group in the sub-node at each pre-intervention time and the actual pre-intervention loss corresponding to each user data in the sub-node are calculated in the form of parallel loss. The parallel loss is used to measure the parallelism between the sub-experimental group and sub-control group in the same sub-node.
4. The method of claim 3, wherein, For each sub-node, based on the predicted customer complaint results for the sub-experimental group and sub-control group belonging to that sub-node at each pre-intervention time, and the actual customer complaint results for each user data point in that sub-node, the pre-intervention loss for that sub-node is calculated in the form of parallel loss, including: For each sub-node, based on whether the sub-experimental group and sub-control group in that sub-node have actual customer complaints at each time before the intervention, the mean interval between the sub-experimental group and the sub-control group is obtained. Based on the actual customer complaint results for each user data point in this sub-node at each pre-intervention time, and the predicted customer complaint results for the sub-experimental group and sub-control group in this sub-node at each pre-intervention time, calculate the individual interval for each user data point in this sub-node at each pre-intervention time; and Based on the mean interval and the individual intervals of each user data in the sub-node at each time point before intervention, the pre-intervention loss corresponding to the sub-node before intervention is calculated in the form of parallel loss.
5. The method of claim 4, wherein, Based on the actual customer complaint results for each user data point in this sub-node at each pre-intervention time, and the predicted customer complaint results for the sub-experimental group and sub-control group in this sub-node at each pre-intervention time, the individual intervals for each user data point in this sub-node at each pre-intervention time are calculated, including: For each user data point in this sub-node at each pre-intervention time, based on the actual result of whether the user data complained at the pre-intervention time and the predicted result of whether another subgroup to which the user data belongs complained at the pre-intervention time, the individual distance of the user data at the pre-intervention time is obtained to represent the distance between the sub-experimental group and the sub-control group.
6. The method of claim 1, further comprising: Based on the actual and predicted results of customer complaints at the post-intervention time points of the multiple sub-nodes, calculate the post-intervention loss for each sub-node.
7. The method of claim 6, wherein, Based on the actual and predicted customer complaint results at the post-intervention time points of the multiple sub-nodes, the post-intervention loss for each sub-node is calculated as follows: For each sub-node, determine whether the actual customer complaint result corresponds to each user data in that sub-node at the time after the intervention, and whether the predicted customer complaint result corresponds to the sub-experimental group or sub-control group to which each user data belongs at the time after the intervention. Based on the correspondence between the actual results of whether or not each user data point is a customer complaint and the predicted results of whether or not each user data point is a customer complaint in the sub-experimental group or sub-control group, the post-intervention loss corresponding to that sub-node is calculated.
8. The method of claim 1, wherein, The splitting stopping condition includes at least one of the following conditions: reaching a specified depth of the causal tree; the splitting feature and / or feature threshold as a splitting condition have been used; and the minimum loss of the parent node is less than the sum of the losses of the multiple child nodes split from the parent node.
9. A method for prediction using a causal tree, wherein, The causal tree used is trained according to any one of claims 1 to 8, and each leaf node of the causal tree includes: a first "whether there is a complaint" prediction result corresponding to the sub-experimental group, a second "whether there is a complaint" prediction result corresponding to the sub-control group, and the mean distance between the sub-experimental group and the sub-control group at the time after intervention. The method includes: Input the user data to be predicted into the causal tree; The user data to be predicted is processed sequentially from the root node to the leaf node using each node on the causal tree, to determine the leaf node to which the user data to be predicted belongs; and The causal effect of the user data to be predicted is estimated based on the first and second customer complaint prediction results and the mean interval in the determined leaf nodes. The causal effect includes changes in the customer complaint rate.
10. The method of claim 9, wherein, The causal effect of the user data to be predicted is estimated based on the first and second prediction results of whether a customer complaint is expected in the determined leaf nodes, as well as the mean interval. The first and second customer complaint prediction results and mean intervals in the determined leaf nodes are calculated using a double difference method to obtain the causal effect of the user data to be predicted.
11. The method of claim 10, wherein, The first and second prediction results of whether a customer complaint is expected, as well as the mean interval, are calculated using a difference-in-differences method in the determined leaf nodes to obtain the causal effects of the user data to be predicted, including: Perform a difference calculation on the first and second "is there a customer complaint?" prediction results in the determined leaf nodes to obtain a first difference result; and A second difference calculation is performed on the first difference result and the determined mean interval to obtain the causal effect of the user data to be predicted.
12. An apparatus for training a causal tree, comprising: The data acquisition unit acquires user data from a financial trading platform, grouped into experimental and control groups. Intervention operations are implemented for users in the experimental group, but not for users in the control group. The intervention operations include at least one of the following: increasing the user's transaction limit, decreasing the user's transaction limit, or removing the user from the financial trading platform. Each user data point includes user segmentation characteristics and the actual customer complaint result obtained at each time point. Each time point includes multiple pre-intervention times and post-intervention times. The prediction result calculation unit calculates the prediction result of whether the sub-experimental group and sub-control group in each sub-node are customer complaints at each time when the experimental group and control group in the current node of the causal tree are split into multiple sub-nodes according to the current splitting conditions. The splitting conditions include user splitting features that are used as the basis for splitting and affect the result of whether the customer complaint is filed. The pre-intervention loss calculation unit calculates the pre-intervention loss corresponding to each sub-node before the intervention based on the predicted and actual results of customer complaints at each pre-intervention time point. The pre-intervention loss corresponding to each sub-node is used to characterize the parallelism between the sub-experimental group and the sub-control group in that sub-node. The conditional loss calculation unit calculates the loss of the current node under the current splitting condition based on the pre-intervention loss and post-intervention loss corresponding to each sub-node. The post-intervention loss for each sub-node is obtained based on the actual customer complaint result and the predicted customer complaint result for that sub-node at the post-intervention time. After obtaining the losses of the current node under each splitting condition, the node splitting unit is triggered. The node splitting unit splits the current node according to the splitting condition with the least loss to obtain the corresponding child nodes; The prediction result calculation unit, the pre-intervention loss calculation unit, the conditional loss calculation unit, and the node splitting unit perform splitting processing on each node in the causal tree until the splitting stop condition is met.
13. An apparatus for prediction using a causal tree, wherein, The causal tree used is trained according to any one of claims 1 to 8, and each leaf node of the causal tree includes: a first "whether there is a complaint" prediction result corresponding to the sub-experimental group, a second "whether there is a complaint" prediction result corresponding to the sub-control group, and the mean distance between the sub-experimental group and the sub-control group at the time after intervention. The device includes: The input unit inputs the user data to be predicted into the causal tree; The causal tree model unit processes the user data to be predicted sequentially from the root node to the leaf node using each node on the causal tree, to determine the leaf node to which the user data to be predicted belongs; and The causal effect estimation unit estimates the causal effect of the user data to be predicted based on the first and second customer complaint prediction results and the mean interval in the determined leaf nodes. The causal effect includes changes in the customer complaint rate.
14. An electronic device, comprising: At least one processor, a memory coupled to the at least one processor, and a computer program stored on the memory, wherein the at least one processor executes the computer program to implement the method as described in any one of claims 1-11.