Data processing method and related device

By dividing the independent account nodes and account-dependent nodes in the data processing method, and using the corresponding causal discovery mechanism, the problem of difficult causal relationship determination in the sample data is solved, and the quality of training samples and model performance are improved.

CN119577433APending Publication Date: 2025-03-07TENCENT TECHNOLOGY (SHENZHEN) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311150248.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-06
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently determine the causal relationship between sample data and sample labels, resulting in low sample quality during model training, unstable model performance and poor interpretability.

Method used

By obtaining the pending samples and sample label features, the generated node set is merged and divided into account independent nodes and account dependencies. Based on the causal mechanism of different types of nodes, different causal discovery mechanisms are adopted to determine high-precision causal relationships and optimize samples to improve training quality.

Benefits of technology

It realizes the construction of high-quality training samples, improves the training accuracy and interpretability of the classification model, and ensures that the model has stable performance under different account information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577433A_ABST
    Figure CN119577433A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and a related device, and the method comprises the steps: generating a feature node and an account node for an obtained to-be-processed sample and a sample label feature; according to a causal relationship between each feature and account information, feature nodes are divided into two types, namely account independent nodes and account dependent nodes. Due to the fact that the causal relationship corresponding to the account independent node does not change along with the change of the account information, and the causal relationship corresponding to the account dependent node changes along with the change of the account information, different causal discovery mechanisms are adopted for targeted causal relationship discovery for different types of feature nodes, and therefore the high-precision causal relationship is determined. Due to the fact that the causal relationship of the target node can visually reflect important factors of an influence mechanism between the data features and the sample label features, the to-be-processed samples can be optimized based on the causal relationship, the quality of the training samples is improved, and the classification model obtained through training can better provide services for classification tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a data processing method and related devices. Background Art

[0002] When using network models for classification and recognition, high requirements are placed on the performance, stability, and interpretability of the model. In order to improve the quality of the model, it is necessary to build high-quality training samples during modeling. Some methods are to screen sample features based on the correlation between sample features and sample labels to improve sample quality.

[0003] A better solution is to start from the perspective of causal modeling and find the dependent variables behind the sample labels. Since causality naturally has the core property of remaining unchanged under intervention, modeling from a causal perspective can usually construct high-quality samples, so that the trained model is more stable and has better interpretability.

[0004] However, there is currently no efficient way to determine the causal relationship between sample data and sample labels. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides a data processing method, which can utilize more information to determine high-precision causal relationships, thereby constructing high-quality training samples to train classification models for classification tasks.

[0006] The embodiments of the present application disclose the following technical solutions:

[0007] On the one hand, an embodiment of the present application provides a data processing method, the method comprising:

[0008] Obtaining samples to be processed and corresponding sample label features related to the classification task, wherein the samples to be processed include account information and data features of multiple dimensions;

[0009] Generate a node set according to the sample label feature, the account information and the data feature, the node set including feature nodes corresponding to the sample label feature and the data feature, and an account node corresponding to the account information, the feature node corresponding to the sample label feature being the target node;

[0010] The feature nodes are divided into account-independent nodes and account-dependent nodes according to the causal relationships between the sample label features, the data features and the account information, respectively. The causal relationships corresponding to the account-independent nodes do not change with changes in the account information, and the causal relationships corresponding to the account-dependent nodes change with changes in the account information.

[0011] Determining a causal relationship related to the account-independent node based on a first causal discovery mechanism for the account-independent node; and determining a causal relationship related to the account-dependent node based on a second causal discovery mechanism for the account-dependent node;

[0012] The samples to be processed are optimized according to the causal relationship related to the target node to obtain training samples for training the classification model of the classification task.

[0013] On the other hand, an embodiment of the present application provides a data processing device, the device comprising an acquisition unit, a generation unit, a division unit, a determination unit and an optimization unit:

[0014] The acquisition unit is used to acquire samples to be processed and corresponding sample label features related to the classification task, wherein the samples to be processed include account information and data features of multiple dimensions;

[0015] The generating unit is used to generate a node set according to the sample label feature, the account information and the data feature, wherein the node set includes feature nodes corresponding to the sample label feature and the data feature, and an account node corresponding to the account information, and the feature node corresponding to the sample label feature is a target node;

[0016] The division unit is used to divide the feature nodes into account-independent nodes and account-dependent nodes according to the causal relationships between the sample label feature, the data feature and the account information, respectively, wherein the causal relationship corresponding to the account-independent node does not change with the change of the account information, and the causal relationship corresponding to the account-dependent node changes with the change of the account information;

[0017] The determining unit is configured to determine the causal relationship associated with the account-independent node based on the first causal discovery mechanism for the account-independent node; and to determine the causal relationship associated with the account-dependent node based on the second causal discovery mechanism for the account-dependent node;

[0018] The optimization unit is used to optimize the samples to be processed according to the causal relationship related to the target node to obtain training samples for training the classification model of the classification task.

[0019] In a possible implementation manner, the determining unit is further configured to:

[0020] Constructing a causal relationship matrix corresponding to the feature node, wherein the value of the i-th row and the j-th column in the causal relationship matrix is ​​used to identify the degree of causal relationship between the i-th feature node and the j-th feature node;

[0021] Determine the difference between each feature node and other feature nodes under the influence of the causal relationship matrix through the feature nodes and the causal relationship matrix, and adjust the value of the causal relationship matrix with minimizing the difference as an optimization goal;

[0022] According to the adjusted causal relationship matrix, a causal relationship pointing to the account independent node is determined, and the direction of the causal relationship is used to identify the result role in the causal relationship.

[0023] In one possible implementation, the determination unit is further used to construct a masking matrix for the account-independent node during the adjustment process of the value of the causal relationship matrix, wherein the value corresponding to the account-dependent node in the masking matrix is ​​set to zero, and the masking matrix is ​​used to shield the influence of the account-dependent node on the account-independent node during the adjustment process.

[0024] In a possible implementation manner, for a node pair consisting of a first node and a second node in a feature node, the determining unit is further configured to:

[0025] Extract any number of characteristic nodes from the remaining characteristic nodes of the node set to generate a condition set;

[0026] Determining an independence parameter of the node pair relative to the condition set, the independence parameter being used to identify a degree of causal relationship between the first node and the second node under the premise that the condition set is satisfied;

[0027] In response to determining that the node pair meets the causal condition according to the independence parameter, and when the first node is an account-independent node and the second node is an account-dependent node, it is determined that there is a causal relationship from the first node to the second node, and the direction of the causal relationship is used to identify the result role in the causal relationship.

[0028] In a possible implementation, the classification task includes a plurality of sample optimization groups, the sample to be processed is in any one of the sample optimization groups, and the determination unit is further configured to:

[0029] Determine the independence parameters corresponding to the node pairs in the plurality of sample optimization groups respectively;

[0030] In response to the independence parameter that meets the causal condition satisfying the quantity condition, and when the first node is an account-independent node and the second node is an account-dependent node, it is determined that there is a causal relationship from the first node to the second node.

[0031] In a possible implementation manner, the determining unit is further configured to:

[0032] In response to determining that the node pair meets a causal condition according to the independence parameter, and when both the first node and the second node are account-dependent nodes, determining that an undetermined directed causal relationship exists between the first node and the second node.

[0033] In a possible implementation manner, for the causal relationship of the undetermined direction, the determining unit is further configured to:

[0034] Determining a pending direction for the causal relationship of the undetermined direction;

[0035] According to the determined causal relationship pointed to and the determined causal relationship pointed to, a to-be-determined causal graph is generated based on the node set;

[0036] Performing linear regression on the causal relationship for the nodes in the undetermined causal graph based on the direction of the causal relationship to obtain a regression result;

[0037] According to the regression results of different pending causal graphs, a target causal graph is determined from the pending causal graphs, and the pending direction in the target causal graph is determined as the actual direction of the causal relationship of the undetermined direction.

[0038] In a possible implementation manner, the optimization unit is further configured to:

[0039] Determine, from the node set, neighboring nodes of the target node according to a causal relationship associated with the target node, the neighboring nodes including a parent node and a child node of the target node;

[0040] The data features corresponding to the parent node and the child node of the target node among the data features of multiple dimensions of the sample to be processed are retained, and other data features are deleted to obtain training samples for training the classification model of the classification task.

[0041] In a possible implementation manner, the dividing unit is further used for:

[0042] Determine a child node of the account node from the feature node according to the causal relationship between the sample label feature, the data feature and the account information respectively;

[0043] The subnodes of the account node are classified as the account-dependent nodes, and the other feature nodes among the feature nodes except the subnodes of the account node are classified as the account-independent nodes.

[0044] In a possible implementation manner, the determining unit is further configured to:

[0045] Acquire the data to be classified involved in the classification task;

[0046] Optimizing the data to be classified according to the causal relationship related to the target node to obtain target data to be classified;

[0047] The classification model that has been trained is used to determine the classification result corresponding to the target data to be classified and the sample label feature.

[0048] On the other hand, an embodiment of the present application provides a computer device, the computer device comprising a processor and a memory:

[0049] The memory is used to store a computer program and transmit the computer program to the processor;

[0050] The processor is configured to execute the method described above according to the computer program.

[0051] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program executes the method described in the above aspects when being executed by a computer device.

[0052] On the other hand, an embodiment of the present application provides a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute the method described in the above aspects.

[0053] It can be seen from the above technical scheme that in order to improve the training accuracy of the classification model involved in the classification task, feature nodes and account nodes are generated for the acquired samples to be processed and sample label features, corresponding to data features and account information of different dimensions respectively. According to the causal relationship between each feature and the account information, the feature nodes are divided into two types: account independent nodes and account dependent nodes. Since the causal relationship corresponding to the account independent node does not change with the change of the account information, and the causal relationship corresponding to the account dependent node changes with the change of the account information, based on the different nature of the causal mechanism, different causal discovery mechanisms are used for different types of feature nodes to carry out targeted causal relationship discovery, thereby more information can be used to determine high-precision causal relationships. Since the causal relationship of the target node can intuitively reflect the important factors of the influencing mechanism between the data features and the sample label features, the samples to be processed can be optimized based on the causal relationship, and the obtained training samples can highlight the data features that have a causal relationship with the sample label features, thereby improving the quality of the training samples, and the classification model trained by it can better provide services for the classification task and have better interpretability. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0055] Figure 1 A schematic diagram of a data processing scenario provided in an embodiment of the present application;

[0056] Figure 2 A method flow chart of a data processing method provided in an embodiment of the present application;

[0057] Figure 3 A schematic diagram of a data processing system provided in an embodiment of the present application;

[0058] Figure 4 A device structure diagram of a data processing device provided in an embodiment of the present application;

[0059] Figure 5 A structural diagram of a terminal device provided in an embodiment of the present application;

[0060] Figure 6 A structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] The embodiments of the present application are described below in conjunction with the accompanying drawings.

[0062] Since causality naturally has the core property of remaining unchanged under intervention, modeling from a causal perspective can usually construct high-quality samples, so that the trained models are more stable and have better interpretability. However, there is currently no more efficient way to determine the causal relationship between sample data and sample labels.

[0063] To this end, an embodiment of the present application provides a data processing method that can utilize more information to determine high-precision causal relationships, thereby constructing high-quality training samples to train classification models for classification tasks.

[0064] The data processing method provided in the embodiments of the present application can be implemented by a computer device, which can be a terminal device or a server, wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Terminal devices include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc. Terminal devices and servers can be directly or indirectly connected via wired or wireless communication, and this application does not limit this.

[0065] It is understandable that in the specific implementation of the present application, the processed data characteristics and account information may involve data related to user information. When the above embodiments of the present application are applied to specific products or technologies, each item needs to obtain user permission or consent separately, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0066] Figure 1 This is a schematic diagram of a data processing scenario provided in an embodiment of the present application. In this implementation, the server 100 is used as an example of the aforementioned computer device for illustration.

[0067] In order to improve the training accuracy of the classification model involved in the classification task, the server 100 generates feature nodes and account nodes for the acquired samples to be processed and sample label features, corresponding to data features and account information of different dimensions respectively. Figure 1 The black dots in the middle represent account nodes, and the white dots represent feature nodes.

[0068] According to the causal relationship between each feature and the account information, the server 100 divides the feature nodes into two types: account-independent nodes and account-dependent nodes. Figure 1 In the figure, white solid dots represent account-independent nodes, and white dotted dots represent account-dependent nodes.

[0069] Since the causal relationship corresponding to the account-independent node does not change with the change of account information, and the causal relationship corresponding to the account-dependent node changes with the change of account information, based on the different nature of the causal mechanism, different causal discovery mechanisms (such as the first causal discovery mechanism and the second causal discovery mechanism) are used for different types of feature nodes to perform targeted causal relationship discovery, thereby utilizing more information to determine high-precision causal relationships.

[0070] Since the causal relationship of the target node can intuitively reflect the important factors of the influencing mechanism between data features and sample label features, the samples to be processed can be optimized based on this causal relationship, and the obtained training samples can more prominently highlight the data features that have a causal relationship with the sample label features. Figure 1 In the figure, arrows between nodes are used to represent causal relationships and corresponding directions. For the target node, the three nodes on the right have a causal relationship with it. Therefore, by optimizing the samples to be processed, the feature nodes at the upper left and lower left are removed, and the remaining four nodes constitute the training samples.

[0071] Through optimization, the quality of training samples is improved and dimension reduction is achieved. The classification model trained by it can better serve the classification task and has better interpretability.

[0072] Figure 2 A method flow chart of a data processing method provided in an embodiment of the present application, the method can be executed by a computer device. In this embodiment, the computer device is a server as an example for explanation, and the method includes:

[0073] S201: Obtain samples to be processed and corresponding sample label features related to the classification task.

[0074] The classification task may involve various classification application scenarios related to user accounts, such as classification and identification scenarios of abnormal transaction behaviors, classification and identification scenarios of specific accounts, etc.

[0075] The samples to be processed are training samples obtained based on the classification task, and their sample label features are used to identify labels related to the classification task, such as whether it is an abnormal transaction behavior, whether it is a specific account, etc.

[0076] The samples to be processed need to be optimized through subsequent causal discovery to improve sample quality. The samples to be processed include account information and data features in multiple dimensions.

[0077] The account information is used to identify the user account that needs to be classified, or the user account involved in the interactive behavior that needs to be classified.

[0078] The data features are features related to this classification task. For example, when this classification task involves a classification and identification scenario of abnormal transaction behaviors, it may include data features of multiple dimensions such as transaction time, transaction amount, and transaction method.

[0079] S202: Generate a node set according to the sample label feature, the account information and the data feature.

[0080] The node set includes feature nodes corresponding to the sample label feature and the data feature, and an account node corresponding to the account information, and the feature node corresponding to the sample label feature is the target node.

[0081] The feature nodes and account nodes in the node set are mainly used to generate the corresponding causal graph. It should be noted that in the embodiment of the present application, compared with the related technology, an account node corresponding to the account information is additionally introduced. Therefore, the causal graph generated based on the feature nodes and account nodes in the present application can be recorded as an augmented causal graph.

[0082] By representing data features, sample label features and account information through various nodes, the causal relationship between data features in each dimension and sample label information can be more intuitively expressed based on the edges between nodes and the directions of the edges.

[0083] S203: Divide the feature nodes into account-independent nodes and account-dependent nodes according to the causal relationship between the sample labels and the data features and the account information.

[0084] Since the classification task in this application mainly involves various classification application scenarios related to user accounts, the direct participant in the application scenario is the user account. In other words, the actual classification result is closely related to the user account.

[0085] In an embodiment of the present application, feature nodes are classified according to whether the causal mechanism of the feature nodes relative to the account nodes has changed, thereby solving the causal discovery problem with a "divide and conquer" strategy.

[0086] In some related technologies, causal discovery has been achieved under the assumption of independent and identical distribution, such as the distributed optimization algorithm Alternating Direction Method of Multipliers (ADMM) for optimization. The premise of this optimization is that the data distribution of each participant obeys the assumption of independent and identical distribution. However, in fact, this assumption does not hold true, that is, the data between the participants are actually heterogeneous, resulting in the accuracy of related technologies in discovering causal relationships being unreliable.

[0087] In the embodiment of the present application, the heterogeneous data of different participants are unified based on the dimension of the participant, i.e., the user account.

[0088] The embodiment of the present application assumes that any unobserved confounding factor in the data feature X as an observed variable can be regarded as a function of the customer index C (i.e., indicating which participant the current data feature comes from, which is a categorical variable). Therefore, for any given user account c, all unobserved confounding factors are fixed, and causal sufficiency holds. In other words, the cause of the heterogeneity mechanism comes from the customer index C.

[0089] For example, suppose that in the causal discovery task that needs to be solved, some participants are from the north and some are from the south. Among the existing features, there is no data feature that directly represents such geographical information. However, according to experience, geographical information usually affects features such as height and monthly consumption, but generally does not affect features such as education level and consumption channels. Although no explicit geographical feature information is observed in the current task, the embodiment of the present application assumes that the account information of the user account can approximately replace the geographical feature information, that is, the different participants from which the data features are derived are the reason for the differences in features such as height and monthly consumption.

[0090] In other words, if we can accurately identify different data features with heterogeneity before the causal relationship is discovered, and use consistent causal discovery methods based on the heterogeneity of account independence and account dependence, it can bring substantial help to the accuracy of subsequent causal discoveries, thereby realizing the "divide and conquer" strategy to solve the causal discovery problem.

[0091] In the embodiment of the present application, the feature nodes are divided into account-independent nodes and account-dependent nodes by the causal relationship between sample labels and data features and account information. The causal relationship corresponding to the account-independent nodes does not change with the change of account information, and the causal relationship corresponding to the account-dependent nodes changes with the change of account information.

[0092] Among them, the account dependency node can be recorded as X in the augmented causal graph. dep , X dep The causal relationship of changes between different participants (account nodes). Account independent nodes can be recorded as X in the augmented causal graph. ind , X ind The causal relationship remains unchanged between different participants (account nodes).

[0093] The causal relationship between sample labels and data features and account information is equivalent to the causal relationship between feature nodes and account nodes. The causal relationship is used to reflect the mutual influence between two nodes when the data changes. For example, the data change of one node a will directly affect the data change of another node b. In this case, it can be considered that there is a causal relationship between nodes a and b, and node a is the cause of the causal relationship, and node b is the result of the causal relationship. It should be noted that this application does not limit the number of causal relationships involved in the same node. For example, the aforementioned node a can also be the cause or result of the causal relationship between node c, and node b can also be the result or cause of the causal relationship between node d.

[0094] It should be noted that the embodiments of the present application do not limit the method for determining the causal relationship between sample label features, data features and account information. For example, prior knowledge can be used to determine the causal relationship between sample label features, data features and account information.

[0095] In a possible implementation, S203 divides the feature nodes into account-independent nodes and account-dependent nodes according to the causal relationship between the sample label feature, the data feature and the account information, including:

[0096] S2031: determining a child node of the account node from the feature node according to the causal relationship between the sample label feature, the data feature and the account information respectively;

[0097] S2032: Classify the child nodes of the account node as the account-dependent nodes, and classify the other feature nodes among the feature nodes except the child nodes of the account node as the account-independent nodes.

[0098] By combining the account index C with the data features X of all dimensions, we can derive the augmented graph G ′ =(X∪C,E′),

[0099] in is x i The set of father nodes on graph G, is the conditional distribution among customers c, and [K] represents the set of positive integers from 1 to K.

[0100] That is, if the variables in G cannot cover x i The generation mechanism of , we need to introduce the account index C to explain, then add a graph from C to x i The edges of the augmented graph G ′ In particular, in the embodiment of the present application, the augmented graph G ′ The characteristic node as a child node of C in can be recorded as an account dependent node, that is, X dep , the remaining feature nodes are called account independent nodes, namely X ind .

[0101] In the present application, the parent-child relationship between nodes can be determined by the direction in the determined causal relationship. In the above example, there is a causal relationship between node a and node b, and node a is the cause in the causal relationship, and node b is the result in the causal relationship. That is, the causal relationship is from node a to node b, and the parent-child relationship under the indication of the causal relationship is: node a is the parent node of node b, and node b is the child node of node a.

[0102] In the example mentioned above where participants (account information) have regional differences, data features such as height and monthly consumption are generally account-dependent nodes, that is, they belong to X dep , while data features such as education level and consumption channels are generally independent nodes of accounts, that is, they belong to X ind . For X dep With X ind Different heterogeneities are found in the present application. Different algorithms are designed to learn their causal mechanisms in a targeted manner, which will be described in detail later and will not be repeated here.

[0103] Through the causal relationship between sample label features, data features and account information, the child nodes of the target node can be effectively determined based on the role (cause or result) of the target node in the corresponding causal relationship. Since the target node plays the role of cause in the causal relationship with the child nodes, when the account information corresponding to the target node changes (for example, account information of different accounts), the data features of its child nodes will change accordingly. Therefore, these child nodes can be accurately determined as account-dependent nodes, while other feature nodes that are not child nodes will not have the property of changing necessarily with changes in account information, and can be determined as account-independent nodes. In this way, account-independent nodes and account-dependent nodes with heterogeneity can be accurately determined based on account information, greatly improving the determination accuracy and efficiency.

[0104] In addition to determining the account-dependent nodes and the account-independent nodes through the above implementation method, a two-sample test method can also be used to determine the account-dependent nodes and the account-independent nodes.

[0105] Essentially, determine X i ∈X ind Or X i ∈X dep Need to determine whether a collection exists So that x i ⊥C|Z. Under certain assumptions, this is equivalent to x i -E[x i |Z]⊥C, that is, x i The residuals after regression on Z are independent of the account information C. In other words, x i Regarding whether the residual distribution after Z regression is consistent among different account information, we can consider using the two-sample test method to make a judgment. Furthermore, if there is a need for security protection, we can also consider determining account-dependent nodes and account-independent nodes based on secure multi-party computing.

[0106] S204: Determine the causal relationship related to the account-independent node based on the first causal discovery mechanism; and determine the causal relationship related to the account-dependent node based on the second causal discovery mechanism.

[0107] Since account-independent nodes and account-dependent nodes are heterogeneous in distribution, after classifying the feature nodes into account-independent and account-dependent ones through S203, different causal discovery mechanisms are used for different types of nodes to discover causal relationships, so as to better utilize the information carried by different types of nodes under different causal discovery mechanisms, so as to learn effective knowledge related to causal relationship discovery.

[0108] S205: Optimizing the samples to be processed according to the causal relationship related to the target node to obtain training samples for training the classification model of the classification task.

[0109] As mentioned above, the target node is the feature node corresponding to the sample label feature. After determining the causal relationship between the feature nodes through the above steps, the feature nodes that have a causal relationship with the target node can be screened out from the feature nodes based on the causal relationship, for example, these feature nodes are recorded as causal nodes. Compared with feature nodes that are not causal nodes, the feature changes of these causal nodes will have a more direct impact on the target node, i.e., the sample label feature, and are an important factor in determining the sample label feature.

[0110] Therefore, based on these characteristics, the server can optimize the samples to be processed according to the causal relationship related to the target node, increase the proportion of data features corresponding to the causal node in the sample, and obtain training samples. The quality of the training samples for classification tasks will be higher than that of the samples to be processed, so that a better quality classification model can be trained through the training samples to provide accurate services for classification tasks.

[0111] It should be noted that the causal relationship discovery method provided in the embodiment of the present application can be applied to scenarios involving some data features that need to be non-public, such as financial risk assessment scenarios. In this scenario, historical data features are often distributed in multiple local data sources, and it is necessary to collaboratively learn causal relationships from various participants in a federated learning manner. In addition, due to the differences behind the data collection process of each data source, there is often a certain heterogeneity between the local distributions of different participants. It is necessary to adopt a federated causal discovery algorithm for heterogeneous data, such as the FedCausality algorithm.

[0112] The method for discovering causal relationships provided in the embodiments of the present application can also be applied to scenarios where data features are publicly available, and conventional causal discovery algorithms can be used in this scenario.

[0113] It can be seen that in order to improve the training accuracy of the classification model involved in the classification task, feature nodes and account nodes are generated for the acquired samples to be processed and sample label features, corresponding to data features and account information of different dimensions respectively. According to the causal relationship between each feature and the account information, the feature nodes are divided into two types: account-independent nodes and account-dependent nodes. Since the causal relationship corresponding to the account-independent node does not change with the change of the account information, and the causal relationship corresponding to the account-dependent node changes with the change of the account information, based on the different nature of the causal mechanism, different causal discovery mechanisms are used for different types of feature nodes to carry out targeted causal relationship discovery, thereby more information can be used to determine high-precision causal relationships. Since the causal relationship of the target node can intuitively reflect the important factors of the influencing mechanism between the data features and the sample label features, the samples to be processed can be optimized based on the causal relationship, and the obtained training samples can highlight the data features that have a causal relationship with the sample label features, thereby improving the quality of the training samples. The classification model trained by it can better provide services for the classification task and has better interpretability.

[0114] Next, we will explain how to conduct targeted causal discovery for account-independent nodes and account-dependent nodes respectively.

[0115] For account independent nodes:

[0116] In a possible implementation, determining the causal relationship related to the account independent node based on the first causal discovery mechanism for the account independent node in S204 includes:

[0117] S11: Construct a causal relationship matrix corresponding to the feature node.

[0118] The value of the i-th row and the j-th column in the causal relationship matrix is ​​used to identify the degree of causal relationship between the i-th feature node and the j-th feature node.

[0119] S12: Determine the difference between each feature node and other feature nodes under the influence of the causal relationship matrix through the feature nodes and adjust the value of the causal relationship matrix with minimizing the difference as the optimization goal.

[0120] S13: Determine the causal relationship pointing to the account independent node according to the adjusted causal relationship matrix.

[0121] The direction of the causal relationship is used to identify the result role in the causal relationship.

[0122] In order to accurately learn the causal relationship related to account independent nodes, this application realizes the discovery of the causal relationship by continuously optimizing the causal relationship matrix.

[0123] The causal relationship matrix can be a matrix of size dxd, where d is the number of nodes in the node set, wherein the value of the i-th row and j-th column in the causal relationship matrix is ​​used to identify the degree of causality between the i-th feature node and the j-th feature node. Thus, the degree of causality of each node can be reflected by the size of each value in the causal relationship matrix, thereby determining whether there is a causal relationship.

[0124] The causality matrix can be an initial value before optimization, and then the value of the causality matrix is ​​adjusted through S12, and this process is repeated to approach the optimization target. After the optimization is completed based on the conditions (for example, reaching a predetermined number of rounds, numerical convergence, etc.), the adjusted causality matrix is ​​obtained. The value size in the adjusted causality matrix can reflect whether each node has a corresponding causal relationship.

[0125] The optimization goal is to minimize the difference between each feature node and other feature nodes under the influence of the causal relationship matrix. Taking the i-th node in the node set (which can be a feature node or an account node) as an example, the i-th row in the causal relationship matrix can correspond to the i-th node, and each value in the i-th row is used to identify the degree of causal relationship between the i-th node and other nodes. Through each node and the corresponding value in the i-th row, a causal feature related to the data feature corresponding to the i-th node can be obtained. When the causal feature is very close to the data feature by adjusting the value of the i-th row, it can be determined that the causal relationship between the i-th node and other nodes has been mined.

[0126] When the causal relationship is scattered in the corresponding values ​​of multiple nodes, it proves that the degree of causal relationship between the i-th node and other nodes is insufficient, and it is determined that the i-th node has no causal relationship with other nodes. When the causal relationship is scattered in the corresponding values ​​of one or a few nodes, and the values ​​are greater than the preset values, it proves that the degree of causal relationship between the i-th node and these nodes is high, and it is determined that the i-th node has a causal relationship with these nodes. In this causal relationship, the i-th node plays the role of the result.

[0127] Therefore, the causal relationship of account-independent nodes can be effectively learned through the causal relationship matrix, and the optimization goal also takes into account the causal invariance characteristics of these account-independent nodes themselves, thereby improving the accuracy of determining the causal relationship of account-independent nodes.

[0128] For X∈X ind For independent nodes of accounts, their causal mechanism is Keep it consistent between different accounts. Therefore, these data are most suitable and easiest to learn together as a sharing mechanism (such as federated learning). Here, this application uses the GOLEM causal discovery algorithm for linear Gaussian data, which is a continuous optimization algorithm (by designing a differentiable objective function, optimizing the causal relationship matrix W corresponding to the causal graph, and when the causal relationship matrix satisfies the acyclic constraint, the optimization problem is solved by the optimization algorithm to obtain the corresponding causal graph), that is, by optimizing the following objective function, the optimal W is obtained. * Make Minimum.

[0129]

[0130]

[0131] in, is an acyclic constraint to ensure that the causal graph corresponding to W is a directed acyclic graph. is a sparse constraint, generally taking the L1 norm, det represents the determinant, I is the unit matrix, and n is the number of samples to be processed.

[0132] Taking federated learning as an example, the FedAvg algorithm is used to optimize A problem arises: Note In Item, the optimization between different mechanisms does not affect each other, X∈X dep The mechanism heterogeneity of X∈X will not affect ind However, the log|det(IW)| term is different. It does not distinguish between account-independent nodes and account-dependent nodes. In other words, X∈X dep The mechanism of X∈X ind The mechanisms are coupled.

[0133] Since the loss function of GOLEM cannot completely isolate the heterogeneous data, if we directly Optimizing W will reduce the learning to X∈X dep The accuracy of the causal relationship, which in turn affects X∈X ind The learning accuracy of causal relationships.

[0134] To this end, in a possible implementation, during the adjustment of the value of the causal relationship matrix, the method further includes:

[0135] A masking matrix for the account-independent node is constructed, in which the values ​​corresponding to the account-dependent node in the masking matrix are set to zero, and the masking matrix is ​​used to shield the influence of the account-dependent node on the account-independent node during the adjustment process.

[0136] That is, this application introduces a masking matrix to shield the heterogeneous mechanism (X∈X dep )

[0137]

[0138] The optimization goal is:

[0139]

[0140] in, is the matrix Hadamard product, and the overall optimization is done by the federated average FedAvg algorithm, so that all pointing to X can be obtained. ind edge.

[0141] In other words, by masking the matrix, the values ​​related to the account-dependent nodes in the causal relationship matrix are shielded, so that during the optimization learning process, the information of the account-dependent nodes does not affect the causal relationship discovery of the account-independent nodes, thereby greatly improving the learning accuracy of the causal relationship of the account-independent nodes.

[0142] Moreover, the influence of account-dependent nodes is shielded in the causal relationship matrix, and the determined causal relationships all point to account-independent nodes, further improving the accuracy of causal relationship determination for account-independent nodes.

[0143] For account dependent nodes:

[0144] In a possible implementation, for a node pair formed by a first node and a second node in a feature node, determining a causal relationship related to the account dependent node based on a second causal discovery mechanism for the account dependent node in S204 includes:

[0145] S21: extracting any number of characteristic nodes from the remaining characteristic nodes of the node set to generate a condition set.

[0146] S22: Determine an independence parameter of the node pair with respect to the condition set.

[0147] The independence parameter is used to identify the degree of causal relationship between the first node and the second node under the premise that the condition set is satisfied;

[0148] S23: In response to determining that the node pair meets the causal condition according to the independence parameter, and when the first node is an account-independent node and the second node is an account-dependent node, determining that there is a causal relationship from the first node to the second node.

[0149] The direction of the causal relationship is used to identify the result role in the causal relationship.

[0150] For account-dependent nodes, we mainly use node pairs to determine the independence of the two nodes in the node pair relative to the condition set at the causal level to perform corresponding causal discovery.

[0151] The condition set is any multiple characteristic nodes in the node set except the node pair. The independence parameter judgment of a node pair can be performed based on at least one condition set. For example, multiple different condition sets can be generated for the node set to determine the independence parameters of the node pair.

[0152] This condition set can be regarded as the assumed condition for generating a causal relationship, that is, the server needs to determine whether the first node and the second node in the node pair have a causal relationship when all the characteristic nodes involved in the assumed condition set occur. If the server determines that the independence parameters between the first node and the second node do not meet the causal condition under each condition set, it can be determined that there is no causal relationship between the first node and the second node.

[0153] If, under each set of conditions, the server determines that at least one of the independence parameters between the first node and the second node meets the causal condition, then it can be determined that there is a causal relationship between the first node and the second node under a specific set of conditions. This is the way to determine conditional independence (CI).

[0154] That is, this application is based on the conditional independence test to determine X ind Point to X dep When causal sufficiency holds, if there is no set So that x i ⊥x j |+, then x i With x j There must be a causal edge between them. In the embodiment of the present application, the CI of the node pair can be determined by partial correlation test, and the causal discovery method based on CI test is usually more robust to distribution shift.

[0155] When X follows a Gaussian distribution, the partial correlation test can be used to test x i ⊥x j |Z for verification. However, C is a categorical variable and cannot be directly put into the condition set (C∈Z) for partial correlation test. CI test with both numerical and categorical variables is very complicated. Fortunately, when judging X i ∈X ind and X j ∈X dep When the CI between C∈Z and The judgment results will not be different. The two results will be different when the following conditions are met:. When , the partial correlation test can be used directly to determine the CI.

[0156] In addition, the intermediate process of the partial correlation test can be protected by the homomorphic encryption Paillier's mechanism, ensuring that sensitive information such as the local mean and variance will not be leaked during the calculation process. In other words, the above CI determination method can also be applied to high privacy requirements scenarios of federated learning. In addition to using homomorphic encryption to eliminate data privacy, a method based on secure multi-party computing protection can also be used, which is not limited in this application.

[0157] It should be noted that the present application does not limit the method for determining the independence parameter of the node pair relative to the condition set, for example, a determination method based on an independence index such as the Hilbert-Schmidt Independence Criterion (HSIC).

[0158] For a small fraction C∈Z and The judgment results are different due to Equivalent to Therefore, this patent uses local CI results to summarize the approximate global CI, that is, Approximate CI(x j ,x l |Z,C). Specifically, if Then we think x j ⊥x l |Z∪{C}. And X i ,X j ∈X dep In the case of , the global CI can also be approximated by this method. Where K is the number of independent optimization groups, which is an integer greater than 1.

[0159] In other words, in order to further improve the accuracy of causal relationship discovery for customer-dependent nodes, multiple independent optimization groups can be further introduced to comprehensively determine the causal relationship discovery results of the node pair through the independence parameters determined by multiple independent optimization groups for the same node pair.

[0160] Therefore, in a possible implementation, the classification task includes a plurality of sample optimization groups, and the to-be-processed sample in any one of the sample optimization groups, and the determination in S23 has a causal relationship from the first node to the second node, includes:

[0161] Determine the independence parameters corresponding to the node pairs in the plurality of sample optimization groups respectively;

[0162] In response to the independence parameter that meets the causal condition satisfying the quantity condition, and when the first node is an account-independent node and the second node is an account-dependent node, it is determined that there is a causal relationship from the first node to the second node.

[0163] A sample optimization group refers to a set of samples that are optimized based on causal relationships by implementing the data processing method provided in the embodiment of the present application through a local client. The sample optimization group includes multiple samples to be processed, and each sample to be processed can be optimized by the data processing method provided in the embodiment of the present application to enhance the influence of data features in the sample that have a causal relationship with the sample label features.

[0164] These multiple samples to be processed can be collected based on the same data source or different data sources. For example, in the scenario of federated learning, since data confidentiality is required between the participants involved in the learning, different sample optimization groups can correspond to different participants (data sources), and the samples to be processed in the same sample optimization group are collected from the same data source. This application does not limit the source of the samples to be processed in different sample optimization groups.

[0165] Different sample optimization groups may be processed by different local clients, or different sample optimization groups may be processed by different independent processing processes of a local client.

[0166] For the same classification task, although the samples to be processed in different sample optimization groups differ in the specific values ​​of data features, the feature dimensions involved are basically the same, that is, the generated node sets are consistent.

[0167] In the discovery of causal relationships, the causal relationships determined by different sample optimization groups may be slightly different, but by aggregating the causal relationship discovery results of each sample optimization group, the global causal relationship discovery results can be approximated. As mentioned earlier, in the CI identification stage, the server can determine whether there is a causal relationship from the first node to the second node for a node pair by aggregating the CI identification results of other local clients (the results of whether the independence parameters meet the causal conditions).

[0168] In the present application, for the same node pair, whether a causal relationship exists is determined mainly based on the number of independence parameters of each sample optimization group that satisfy the causal condition.

[0169] For example, when there are 10 sample optimization groups, for the same node pair, the server finds through local aggregation that the independence parameters of 8 sample optimization groups meet the causal condition, and the independence parameters of 2 sample optimization groups do not meet the causal condition. When the quantity condition is 60%, based on the above formula: This is equivalent to h taking a value of 0.6, K=8, and 6 of the results are True.

[0170] Since it is determined that 80% of the node pairs meet the causal condition and the quantity condition is met, the server can determine that the node pair has a causal relationship from the first node to the second node.

[0171] By aggregating the CI identification results of the local client, we can comprehensively consider the differences in the causal relationship discovery results of different sample optimization groups, avoid the impact of local data errors on the accuracy of the overall causal relationship, and thus improve the robustness and stability of the causal relationship discovery results.

[0172] It should be noted that if X is determined by the above method i ∈X ind and X j ∈X dep There is an edge (causal relationship) between them. Since W has been optimized in the previous stage, all the links pointing to X have been found. ind Therefore, we can determine that the direction of the edge must be X i →X j . And X dep Although the internal edges can be clearly identified, it is difficult to directly determine the direction of the causal relationship through CI identification.

[0173] That is to say, based on the embodiments corresponding to the above S21-S23, in a possible implementation manner, the method further includes:

[0174] S24: In response to determining that the node pair meets a causal condition according to the independence parameter, and when both the first node and the second node are account-dependent nodes, determining that there is an undetermined causal relationship between the first node and the second node.

[0175] It should be noted that S24 and S23 are merely distinguishing numbers and do not play a role in limiting the smooth execution of these two steps.

[0176] In this case, both the first node and the second node are account-dependent nodes. Without the assistance of the causal relationship identification results of the previous account-independent nodes, it is difficult to determine which of the first node and the second node plays the role of cause and effect in this causal relationship. Therefore, in this case, although it can be determined that there is a causal relationship between the first node and the second node, the direction of the causal relationship is not clear.

[0177] To this end, in a possible implementation, for the causal relationship that is not determined, determining the causal relationship related to the account-dependent node based on the second causal discovery mechanism includes:

[0178] S31: determining a pending direction for the causal relationship of the undetermined direction;

[0179] S32: generating a pending causal graph based on the node set according to the determined causal relationship of the pointing and the determined causal relationship of the pending pointing;

[0180] S33: performing linear regression on the causal relationship for the nodes in the undetermined causal graph based on the direction of the causal relationship to obtain a regression result;

[0181] S34: Determine a target causal graph from the pending causal graphs according to the regression results of the different pending causal graphs, and determine the pending direction in the target causal graph as the actual direction of the causal relationship of the undetermined direction.

[0182] Heterogeneity naturally contains more information than independent and identically distributed data, some of which can be used to assist in causal discovery. Based on the principle of independent causal mechanisms, and are two independent causal mechanisms, that is, between different account information, and are independent changes, and the two do not affect each other. However, and However, they usually do not vary independently. Therefore, this application uses this antisymmetry to determine X dep The direction of the internal edge. Specifically, enumerate each edge with an undetermined direction, filter out the undetermined causal graphs that are directed acyclic graphs and put them into the collection. For each pending causal graph For each node x on the causal graph G to be determined i All from his father Do linear regression and calculate Represents x i The causal mechanism estimated on G. Among them, represents the regression coefficient, represents the standard deviation of the residual distribution obtained from regression. i and θ j , calculate the independence between its mechanism attributes:

[0183]

[0184] Among them, Ind(·,·) represents the index of computational independence, which can be realized by the correlation coefficient. It can be proved that the true causal graph Γ(G * )=0, when the sparse mechanism migration assumption is satisfied and the number of participants (account information) →∞, G * is the strict minimum solution of the above equation. * The corresponding pending causal graph is the target causal graph.

[0185] That is to say, for the causal relationship whose direction is not determined, the server can first assume a direction, select the directed acyclic graph that meets the requirements of the causal graph as the pending causal graph, and then obtain the regression result through linear regression. Since the assumed direction can determine multiple different pending causal graphs, based on the regression results of different pending causal graphs, the target causal graph is determined based on the above formula, and the pending direction in the target causal graph is determined as the actual direction of the causal relationship of the undetermined direction.

[0186] Therefore, for different types of feature nodes, the first causal discovery mechanism and the second causal discovery mechanism that are consistent with the type are adopted to determine the causal relationship pointing to the account-independent node, the causal relationship of executing the account-dependent node from the account-independent node, and the causal relationship between the account-dependent nodes, respectively. Based on these causal relationships, a causal graph corresponding to the classification task can be generated, and then according to the causal relationship related to the target node shown in the causal graph, the samples to be processed can be optimized to obtain training samples with higher quality relative to the classification task.

[0187] In a possible implementation, S205: optimizing the samples to be processed according to the causal relationship related to the target node to obtain training samples for training the classification model of the classification task includes:

[0188] S2051: Determine neighboring nodes of the target node from the node set according to a causal relationship associated with the target node, where the neighboring nodes include a parent node and a child node of the target node;

[0189] S2052: retain the data features corresponding to the parent node and child node of the target node among the data features of multiple dimensions of the sample to be processed, delete other data features, and obtain training samples for training the classification model of the classification task.

[0190] As mentioned above, the characteristic changes of the causal relationship related to the target node will have a more direct impact on the target node, i.e., the sample label characteristics, compared with other characteristic nodes, and are important factors in determining the sample label characteristics. The more direct the causal relationship with the target node, the greater the impact on the target node, i.e., the sample label characteristics. For example, the child node and parent node determined by the target node based on the causal relationship are both causal relationships directly related to the target node, and its parent node is the cause of the causal relationship related to the target node, and its child node is the result of the causal relationship related to the target node.

[0191] Therefore, the neighboring nodes of the target node determined from the node set based on the causal relationship need to include the parent node and child node of the target node, and further include the spouse node of the target node, which can be the parent node of the child node of the target node, except the target node. Therefore, the neighboring nodes can be regarded as the Markov Blanket of the target node.

[0192] Since, except for the neighboring nodes, other feature nodes in the node set are not so important for the representation of the target node, they can be deleted from the samples to be processed as redundant features. Compared with the samples to be processed, the data dimension of the training samples can not only be effectively reduced, thus achieving the effect of dimensionality reduction, but also can highlight the important features relative to the sample label features in the training samples.

[0193] Next, through Figure 3 Continue to explain the implementation method of this application.

[0194] exist Figure 3 The scenario shown includes K sample optimization groups for classification tasks, where K is greater than or equal to 2. In this scenario, K is an integer greater than or equal to 3. The K sample optimization groups are respectively processed by K local clients for sample optimization. Each local client can be regarded as a computer device mentioned in an embodiment of the present application. The causal relationship discovery results of the K local clients can be aggregated to a server so that the server determines the final causal relationship discovery results based on global information, and uses this to optimize the samples to be processed in each sample optimization group to obtain training samples.

[0195] Each sample optimization group includes a plurality of samples to be processed, and the number of samples to be processed in different sample optimization groups may be different. The data sources of the samples to be processed in different sample optimization groups may be different, for example, from different platforms.

[0196] The classification task can be illegal transaction detection for online electronic transactions. By performing causal discovery on the sample label features and the corresponding data features, the Markov blanket of the classification label is found as the result of feature selection. Finding the Markov blanket of the label through causal relationships can eliminate the redundant parts of the data features. In theory, the Markov blanket contains all the information related to the sample label features in the data features. In subsequent classification and training, only the data features corresponding to the Markov blanket can be considered, without considering the other data features, thereby achieving the effect of data dimensionality reduction in the classification and training stages.

[0197] Specifically, because causal relationships naturally have core properties that remain unchanged under intervention, modeling from a causal perspective can usually make the model more stable and better interpretable.

[0198] According to the heterogeneity of the causal mechanism among different participants (account information), the feature nodes are classified into account-dependent nodes X dep (Causal mechanisms are heterogeneous among participants) and account independent node X ind (causal mechanisms are homogeneous across participants),

[0199] Then, the local client adopts a divide-and-conquer strategy to determine the causal relationship between different types of nodes. For example, the FedAvg algorithm can be used to optimize the continuous optimization algorithm to determine the node pointing to X. ind The edge of X is determined based on the conditional independence calculation (CI Tests). ind Point to X dep In the process, homomorphic encryption can be used to protect data features from being leaked, and X is determined based on the Independent Causal Mechanisms Principle (ICM Principle). dep The orientation of the internal edges.

[0200] For example, for a classification task related to transactions, a computer device may load historical distributed transaction data records, including sample labels Y and their corresponding data features X. The algorithm FedCausality of this application is called to perform causal discovery on X∪Y, and a causal graph G is obtained for identifying the causal relationship discovery results. * By G * Find the Markov blanket MB(Y) of Y as the result of feature selection for sample optimization, remove X\MB(Y) from the sample, and obtain the training samples to train the classification model corresponding to the classification task.

[0201] When actually classifying the data to be classified in the classification task, in a possible implementation method, the following steps are included:

[0202] S41: Acquire the data to be classified involved in the classification task;

[0203] S42: Optimizing the data to be classified according to the causal relationship related to the target node to obtain target data to be classified;

[0204] S43: Determine the classification result corresponding to the target data to be classified and the sample label feature through the trained classification model.

[0205] In the subsequent business processing through the classification model, MB(Y) is used to optimize the data to be classified, and data features irrelevant to the classification task are filtered out from the data to be classified to obtain the target data to be classified. According to the target data to be classified, the corresponding classification prediction result is obtained through the classification model.

[0206] Figure 4 The device structure diagram of a data processing device provided in an embodiment of the present application, the data processing device 400 includes an acquisition unit 401, a generation unit 402, a division unit 403, a determination unit 404 and an optimization unit 405:

[0207] The acquisition unit 401 is used to acquire samples to be processed and corresponding sample label features related to the classification task, wherein the samples to be processed include account information and data features of multiple dimensions;

[0208] The generating unit 402 is used to generate a node set according to the sample label feature, the account information and the data feature, wherein the node set includes feature nodes corresponding to the sample label feature and the data feature, and an account node corresponding to the account information, and the feature node corresponding to the sample label feature is a target node;

[0209] The division unit 403 is used to divide the feature nodes into account-independent nodes and account-dependent nodes according to the causal relationships between the sample label feature, the data feature and the account information, respectively, wherein the causal relationship corresponding to the account-independent node does not change with the change of the account information, and the causal relationship corresponding to the account-dependent node changes with the change of the account information;

[0210] The determining unit 404 is configured to determine the causal relationship associated with the account-independent node based on the first causal discovery mechanism for the account-independent node; and to determine the causal relationship associated with the account-dependent node based on the second causal discovery mechanism for the account-dependent node;

[0211] The optimization unit 405 is used to optimize the samples to be processed according to the causal relationship related to the target node to obtain training samples for training the classification model of the classification task.

[0212] In a possible implementation manner, the determining unit is further configured to:

[0213] Constructing a causal relationship matrix corresponding to the feature node, wherein the value of the i-th row and the j-th column in the causal relationship matrix is ​​used to identify the degree of causal relationship between the i-th feature node and the j-th feature node;

[0214] Determine the difference between each feature node and other feature nodes under the influence of the causal relationship matrix through the feature nodes and the causal relationship matrix, and adjust the value of the causal relationship matrix with minimizing the difference as an optimization goal;

[0215] According to the adjusted causal relationship matrix, a causal relationship pointing to the account independent node is determined, and the direction of the causal relationship is used to identify the result role in the causal relationship.

[0216] In one possible implementation, the determination unit is further used to construct a masking matrix for the account-independent node during the adjustment process of the value of the causal relationship matrix, wherein the value corresponding to the account-dependent node in the masking matrix is ​​set to zero, and the masking matrix is ​​used to shield the influence of the account-dependent node on the account-independent node during the adjustment process.

[0217] In a possible implementation manner, for a node pair consisting of a first node and a second node in a feature node, the determining unit is further configured to:

[0218] Extract any number of characteristic nodes from the remaining characteristic nodes of the node set to generate a condition set;

[0219] Determining an independence parameter of the node pair relative to the condition set, the independence parameter being used to identify a degree of causal relationship between the first node and the second node under the premise that the condition set is satisfied;

[0220] In response to determining that the node pair meets the causal condition according to the independence parameter, and when the first node is an account-independent node and the second node is an account-dependent node, it is determined that there is a causal relationship from the first node to the second node, and the direction of the causal relationship is used to identify the result role in the causal relationship.

[0221] In a possible implementation, the classification task includes a plurality of sample optimization groups, the sample to be processed is in any one of the sample optimization groups, and the determination unit is further configured to:

[0222] Determine the independence parameters corresponding to the node pairs in the plurality of sample optimization groups respectively;

[0223] In response to the independence parameter that meets the causal condition satisfying the quantity condition, and when the first node is an account-independent node and the second node is an account-dependent node, it is determined that there is a causal relationship from the first node to the second node.

[0224] In a possible implementation manner, the determining unit is further configured to:

[0225] In response to determining that the node pair meets a causal condition according to the independence parameter, and when both the first node and the second node are account-dependent nodes, determining that an undetermined directed causal relationship exists between the first node and the second node.

[0226] In a possible implementation manner, for the causal relationship of the undetermined direction, the determining unit is further configured to:

[0227] Determining a pending direction for the causal relationship of the undetermined direction;

[0228] According to the determined causal relationship pointed to and the determined causal relationship pointed to, a to-be-determined causal graph is generated based on the node set;

[0229] Performing linear regression on the causal relationship for the nodes in the undetermined causal graph based on the direction of the causal relationship to obtain a regression result;

[0230] According to the regression results of different pending causal graphs, a target causal graph is determined from the pending causal graphs, and the pending direction in the target causal graph is determined as the actual direction of the causal relationship of the undetermined direction.

[0231] In a possible implementation manner, the optimization unit is further configured to:

[0232] Determine, from the node set, neighboring nodes of the target node according to a causal relationship associated with the target node, the neighboring nodes including a parent node and a child node of the target node;

[0233] The data features corresponding to the parent node and the child node of the target node among the data features of multiple dimensions of the sample to be processed are retained, and other data features are deleted to obtain training samples for training the classification model of the classification task.

[0234] In a possible implementation manner, the dividing unit is further used for:

[0235] Determine a child node of the account node from the feature node according to the causal relationship between the sample label feature, the data feature and the account information respectively;

[0236] The subnodes of the account node are classified as the account-dependent nodes, and the other feature nodes among the feature nodes except the subnodes of the account node are classified as the account-independent nodes.

[0237] In a possible implementation manner, the determining unit is further configured to:

[0238] Acquire the data to be classified involved in the classification task;

[0239] Optimizing the data to be classified according to the causal relationship related to the target node to obtain target data to be classified;

[0240] The classification model that has been trained is used to determine the classification result corresponding to the target data to be classified and the sample label feature.

[0241] It can be seen that in order to improve the training accuracy of the classification model involved in the classification task, feature nodes and account nodes are generated for the acquired samples to be processed and sample label features, corresponding to data features and account information of different dimensions respectively. According to the causal relationship between each feature and the account information, the feature nodes are divided into two types: account-independent nodes and account-dependent nodes. Since the causal relationship corresponding to the account-independent node does not change with the change of the account information, and the causal relationship corresponding to the account-dependent node changes with the change of the account information, based on the different nature of the causal mechanism, different causal discovery mechanisms are used for different types of feature nodes to carry out targeted causal relationship discovery, thereby more information can be used to determine high-precision causal relationships. Since the causal relationship of the target node can intuitively reflect the important factors of the influencing mechanism between the data features and the sample label features, the samples to be processed can be optimized based on the causal relationship, and the obtained training samples can highlight the data features that have a causal relationship with the sample label features, thereby improving the quality of the training samples. The classification model trained by it can better provide services for the classification task and has better interpretability.

[0242] The embodiment of the present application further provides a computer device, which is the computer device described above and may include a terminal device or a server, and the data processing device described above may be configured in the computer device. The computer device is described below in conjunction with the accompanying drawings.

[0243] If the computer device is a terminal device, see Figure 5 As shown, the embodiment of the present application provides a terminal device, taking the terminal device as a mobile phone as an example:

[0244] Figure 5 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Figure 5The mobile phone includes: a radio frequency (RF) circuit 1410, a memory 1420, an input unit 1430, a display unit 1440, a sensor 1450, an audio circuit 1460, a wireless fidelity (WiFi) module 1470, a processor 1480, and a power supply 1490. Those skilled in the art can understand that Figure 5 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0245] Combine the following Figure 5 A detailed introduction to the various components of the mobile phone:

[0246] The RF circuit 1410 may be used for receiving and sending signals during information transmission or communication or during a call. In particular, after receiving downlink information from a base station, the information is sent to the processor 1480 for processing. In addition, the uplink data is sent to the base station.

[0247] The memory 1420 can be used to store software programs and modules. The processor 1480 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1420. The memory 1420 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 1420 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0248] The input unit 1430 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the mobile phone. Specifically, the input unit 1430 may include a touch panel 1431 and other input devices 1432 .

[0249] The display unit 1440 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 1440 may include a display panel 1441.

[0250] The mobile phone may also include at least one sensor 1450, such as a light sensor, a motion sensor, and other sensors.

[0251] The audio circuit 1460 , the speaker 1461 , and the microphone 1462 can provide an audio interface between the user and the mobile phone.

[0252] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 1470. It provides users with wireless broadband Internet access.

[0253] Processor 1480 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in memory 1420 and calling data stored in memory 1420.

[0254] The mobile phone also includes a power source 1490 (such as a battery) for supplying power to various components.

[0255] In this embodiment, the processor 1480 included in the terminal device also has the following functions:

[0256] Obtaining samples to be processed and corresponding sample label features related to the classification task, wherein the samples to be processed include account information and data features of multiple dimensions;

[0257] Generate a node set according to the sample label feature, the account information and the data feature, the node set including feature nodes corresponding to the sample label feature and the data feature, and an account node corresponding to the account information, the feature node corresponding to the sample label feature being the target node;

[0258] The feature nodes are divided into account-independent nodes and account-dependent nodes according to the causal relationships between the sample label features, the data features and the account information, respectively. The causal relationships corresponding to the account-independent nodes do not change with changes in the account information, and the causal relationships corresponding to the account-dependent nodes change with changes in the account information.

[0259] Determining a causal relationship related to the account-independent node based on a first causal discovery mechanism for the account-independent node; and determining a causal relationship related to the account-dependent node based on a second causal discovery mechanism for the account-dependent node;

[0260] The samples to be processed are optimized according to the causal relationship related to the target node to obtain training samples for training the classification model of the classification task.

[0261] If the computer device is a server, the present application embodiment also provides a server, see Figure 6 As shown, Figure 6The structural diagram of the server 1500 provided in the embodiment of the present application, the server 1500 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1522 (for example, one or more processors) and a memory 1532, and one or more storage media 1530 (for example, one or more mass storage devices) storing application programs 1542 or data 1544. Among them, the memory 1532 and the storage medium 1530 can be short-term storage or permanent storage. The program stored in the storage medium 1530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the central processing unit 1522 can be configured to communicate with the storage medium 1530 and execute a series of instruction operations in the storage medium 1530 on the server 1500.

[0262] The server 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input and output interfaces 1558, and / or one or more operating systems 1541, such as Windows Server 2003 or Windows Server 2008. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.

[0263] The steps performed by the server in the above embodiment can be based on Figure 6 The server structure shown.

[0264] In addition, an embodiment of the present application further provides a storage medium, wherein the storage medium is used to store a computer program, and the computer program is used to execute the method provided in the above embodiment.

[0265] The embodiments of the present application also provide a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute the method provided in the above embodiments.

[0266] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the above program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the above storage medium can be at least one of the following media: read-only memory (English: Read-only Memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store computer programs.

[0267] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0268] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a technician familiar with the technical field within the technical scope disclosed in the present application should be included in the protection scope of the present application. Moreover, based on the implementation methods provided in the above aspects, the present application can also be further combined to provide more implementation methods. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data processing method, characterized in that: The method comprises: Obtaining samples to be processed and corresponding sample label features related to the classification task, wherein the samples to be processed include account information and data features of multiple dimensions; Generate a node set according to the sample label feature, the account information and the data feature, the node set including feature nodes corresponding to the sample label feature and the data feature, and an account node corresponding to the account information, the feature node corresponding to the sample label feature being the target node; The feature nodes are divided into account-independent nodes and account-dependent nodes according to the causal relationships between the sample label features, the data features and the account information, respectively. The causal relationships corresponding to the account-independent nodes do not change with changes in the account information, and the causal relationships corresponding to the account-dependent nodes change with changes in the account information. Determining a causal relationship related to the account-independent node based on a first causal discovery mechanism for the account-independent node; and determining a causal relationship related to the account-dependent node based on a second causal discovery mechanism for the account-dependent node; The samples to be processed are optimized according to the causal relationship related to the target node to obtain training samples for training the classification model of the classification task.

2. The method according to claim 1, characterized in that The determining, based on the first causal discovery mechanism, a causal relationship related to the account independent node includes: Constructing a causal relationship matrix corresponding to the feature node, wherein the value of the i-th row and the j-th column in the causal relationship matrix is ​​used to identify the degree of causal relationship between the i-th feature node and the j-th feature node; Determine the difference between each feature node and other feature nodes under the influence of the causal relationship matrix through the feature nodes and the causal relationship matrix, and adjust the value of the causal relationship matrix with minimizing the difference as an optimization goal; According to the adjusted causal relationship matrix, a causal relationship pointing to the account independent node is determined, and the direction of the causal relationship is used to identify the result role in the causal relationship.

3. The method according to claim 2, characterized in that In the process of adjusting the value of the causal relationship matrix, the method further includes: A masking matrix for the account-independent node is constructed, in which the values ​​corresponding to the account-dependent node in the masking matrix are set to zero, and the masking matrix is ​​used to shield the influence of the account-dependent node on the account-independent node during the adjustment process.

4. The method according to claim 1, characterized in that For a node pair consisting of a first node and a second node in a feature node, determining a causal relationship related to the account dependent node based on a second causal discovery mechanism for the account dependent node includes: Extract any number of characteristic nodes from the remaining characteristic nodes of the node set to generate a condition set; Determining an independence parameter of the node pair relative to the condition set, the independence parameter being used to identify a degree of causal relationship between the first node and the second node under the premise that the condition set is satisfied; In response to determining that the node pair meets the causal condition according to the independence parameter, and when the first node is an account-independent node and the second node is an account-dependent node, it is determined that there is a causal relationship from the first node to the second node, and the direction of the causal relationship is used to identify the result role in the causal relationship.

5. The method according to claim 4, characterized in that The classification task includes a plurality of sample optimization groups, the sample to be processed is in any one of the sample optimization groups, and the determining of a causal relationship from the first node to the second node includes: Determine the independence parameters corresponding to the node pairs in the plurality of sample optimization groups respectively; In response to the independence parameter that meets the causal condition satisfying the quantity condition, and when the first node is an account-independent node and the second node is an account-dependent node, it is determined that there is a causal relationship from the first node to the second node.

6. The method according to claim 4, characterized in that The method further comprises: In response to determining that the node pair meets a causal condition according to the independence parameter, and when both the first node and the second node are account-dependent nodes, determining that an undetermined directed causal relationship exists between the first node and the second node.

7. The method according to claim 6, characterized in that For the causal relationship that is not determined, determining the causal relationship related to the account-dependent node based on the second causal discovery mechanism includes: Determining a pending direction for the causal relationship of the undetermined direction; According to the determined causal relationship pointed to and the determined causal relationship pointed to, a to-be-determined causal graph is generated based on the node set; Performing linear regression on the causal relationship for the nodes in the undetermined causal graph based on the direction of the causal relationship to obtain a regression result; According to the regression results of different pending causal graphs, a target causal graph is determined from the pending causal graphs, and the pending direction in the target causal graph is determined as the actual direction of the causal relationship of the undetermined direction.

8. The method according to any one of claims 1 to 7, characterized in that: The step of optimizing the samples to be processed according to the causal relationship associated with the target node to obtain training samples for training the classification model of the classification task includes: Determine, from the node set, neighboring nodes of the target node according to a causal relationship associated with the target node, the neighboring nodes including a parent node and a child node of the target node; The data features corresponding to the parent node and the child node of the target node among the data features of multiple dimensions of the sample to be processed are retained, and other data features are deleted to obtain training samples for training the classification model of the classification task.

9. The method according to any one of claims 1 to 7, characterized in that: The dividing the feature nodes into account-independent nodes and account-dependent nodes according to the causal relationship between the sample label feature, the data feature and the account information respectively includes: Determine a child node of the account node from the feature node according to the causal relationship between the sample label feature, the data feature and the account information respectively; The subnodes of the account node are classified as the account-dependent nodes, and the other feature nodes among the feature nodes except the subnodes of the account node are classified as the account-independent nodes.

10. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: Acquire the data to be classified involved in the classification task; Optimizing the data to be classified according to the causal relationship related to the target node to obtain target data to be classified; The classification model that has been trained is used to determine the classification result corresponding to the target data to be classified and the sample label feature.

11. A data processing device, characterized in that: The device comprises an acquisition unit, a generation unit, a division unit, a determination unit and an optimization unit: The acquisition unit is used to acquire samples to be processed and corresponding sample label features related to the classification task, wherein the samples to be processed include account information and data features of multiple dimensions; The generating unit is used to generate a node set according to the sample label feature, the account information and the data feature, wherein the node set includes feature nodes corresponding to the sample label feature and the data feature, and an account node corresponding to the account information, and the feature node corresponding to the sample label feature is a target node; The division unit is used to divide the feature nodes into account-independent nodes and account-dependent nodes according to the causal relationships between the sample label feature, the data feature and the account information, respectively, wherein the causal relationship corresponding to the account-independent node does not change with the change of the account information, and the causal relationship corresponding to the account-dependent node changes with the change of the account information; The determining unit is configured to determine the causal relationship associated with the account-independent node based on the first causal discovery mechanism for the account-independent node; and to determine the causal relationship associated with the account-dependent node based on the second causal discovery mechanism for the account-dependent node; The optimization unit is used to optimize the samples to be processed according to the causal relationship related to the target node to obtain training samples for training the classification model of the classification task.

12. A computer device, characterized in that: The computer device comprises a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is configured to execute the method according to any one of claims 1 to 10 according to the computer program.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and when the computer program is executed by a computer device, the method according to any one of claims 1 to 10 is implemented.

14. A computer program product comprising a computer program, which, when executed on a computer device, causes the computer device to execute the method according to any one of claims 1 to 10.