Various implementations of the present disclosure relate to a probability model, and more specifically, to a method, system and computer program product for determining a causality.
A probability model is a graphical network model obtained based on probabilistic inference, which refers to obtaining association relationships between a plurality of variables by analyzing collected information that corresponds to these variables. Bayesian networks are probabilistic models proposed for solving uncertainty and incompleteness, which have been widely used in a plurality of areas.
A Bayesian network may describe causalities between a plurality of variables via a directed acyclic graph (DAG) which may comprise nodes representing variables as well as directed edges and paths representing causalities between these variables. For example, a directed edge of a parent node pointing to its child node may indicate: a variable represented by the parent node and a variable represented by the child node have a direct causality. In another example, a path of one node pointing to another node may indicate: variables represented by these two nodes have an indirect causality. Bayesian networks are applicable to express and analyze uncertain and probabilistic events and may be determined from incomplete, inexact or uncertain information that is collected corresponding to a plurality of variables.
Technical solutions have been developed for determining a causality based on collected data sets and expert knowledge. However, these technical solutions impose requirements that are too harsh on expert knowledge or may involve interaction with experts during determination of the causality. Therefore, a focus of research has become an easy and effective way for determining a causality between a plurality of variables based on expert knowledge (which may be imperfect).
Expert knowledge can improve accuracy of the causality between a plurality of variables determined purely based on data sets to some extent. Therefore, it is desirable to develop and implement a technical solution for determining a causality based on expert knowledge more accurately and effectively. It is desired that the technical solution can use expert knowledge to guide a learning process of the causality as much as possible.
According to a first aspect of the present disclosure, a method is provided for determining a causality between a plurality of vectors. The method comprises: in response to a data set of a plurality of samples associated with the plurality of variables being collected, obtaining a matrix describing the causality between the plurality of variables, each sample among the plurality of samples comprising data that corresponds to the plurality of variables; determining a fitness degree and an expert knowledge constraint which are associated with the causality based on the data set and the matrix, where the expert knowledge constraint comprises at least one of an edge constraint on a direct causality between two variables in the matrix and a path constraint on an indirect causality between two variables in the matrix; building a problem formula describing the causality according to the determined fitness degree and expert knowledge constraint; and solving the built problem formula so as to obtain a candidate result of the matrix.
According to a second aspect of the present disclosure, a system is provided for determining a causality between a plurality of variables, the system comprising: one or more processors; a memory coupled to at least one processor of the one or more processors; computer program instructions stored in the memory which, when executed by the at least one processor, cause the system to execute a method for determining a causality between a plurality of variables. The method comprises: in response to a data set of a plurality of samples associated with the plurality of variables being collected, obtaining a matrix describing the causality between the plurality of variables, each sample among the plurality of samples comprising data that corresponds to the plurality of variables; determining a fitness degree and an expert knowledge constraint which are associated with the causality based on the data set and the matrix, where the expert knowledge constraint comprises at least one of an edge constraint on a direct causality between two variables in the matrix and a path constraint on an indirect causality between two variables in the matrix; building a problem formula describing the causality according to the determined fitness degree and expert knowledge constraint; and solving the built problem formula so as to obtain a candidate result of the matrix.
According to a third aspect of the present disclosure, a device is provided for determining a causality between a plurality of vectors. The device comprises: an obtaining module configured to, in response to a data set of a plurality of samples associated with the plurality of variables being collected, obtain a matrix describing the causality between the plurality of variables, each sample among the plurality of samples comprising data that corresponds to the plurality of variables; a determining module configured to determine a fitness degree and an expert knowledge constraint which are associated with the causality based on the data set and the matrix, where the expert knowledge constraint comprises at least one of an edge constraint on a direct causality between two variables in the matrix and a path constraint on an indirect causality between two variables in the matrix; a building module configured to build a problem formula describing the causality according to the determined fitness degree and expert knowledge constraint; and a solving module configured to solve the built problem formula so as to obtain a candidate result of the matrix.
According to a fourth aspect of the present disclosure, a computer program product is provided. The computer program product comprises a computer-readable storage medium with a computer-readable program stored thereon, where the computer-readable program, when executed on a computing device, causes a computing device to implement the method for determining a causality between a plurality of variables.
By means of the technical solution for determining causality between a plurality of variables as described in the present disclosure, it is possible to give corresponding constraints for an edge and a path in a directed graph based on expert knowledge and further for a more accurately determined causality.
Through the more detailed description in the accompanying drawings, features, advantages and other aspects of implementations of the present disclosure will become more apparent. Several implementations of the present disclosure are illustrated schematically and are not intended to limit the present invention. In the drawings:
The preferred implementations of the present disclosure will be described in more detail with reference to the drawings. Although the drawings illustrate the preferred implementations of the present disclosure, it should be appreciated that the present disclosure can be implemented in various ways and should not be limited to the implementations explained herein. On the contrary, these implementations are provided to make the present disclosure more thorough and complete and to fully convey the scope of the present disclosure to those skilled in the art.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or computer program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or one embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, in some implementations, the present disclosure may take the form of a computer program product embodied in one or more computer-readable medium(s) having computer-readable program code embodied thereon.
Any combination of one or more computer-readable medium(s) may be utilized. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer-readable signal medium may be any computer-readable medium other than a computer-readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire-line, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the scenario related to the remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or a connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
Aspects of the present disclosure are described below with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to implementations of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or another programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or the other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable medium that can direct a computer, another programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer-readable medium produce an article of manufacture including instructions which implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer, another programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
For the sake of description, first an introduction is given to an example of a specific application environment of the present disclosure. Causality analysis based on a Bayesian network may be applied in various application environments. For example, in an application environment for monitoring whether a control system in a specific area is abnormal, information (e.g., information collected at different time points) corresponding to a plurality of variables (e.g., temperature, humidity, . . . , at a specified location in the specific area and whether the control system is abnormal) may be collected, respectively. There is no limit to the number of variables p, but there may be several variables in a simple application environment, and the number of variables p may reach dozens or even more in a complex application environment.
Information corresponding to variables which is collected at one time point may be stored into one sample (a vector comprising a plurality of dimensions), and at this point information collected at n time points may be stored into n samples (here, the n samples may be referred to as a collected data set). Subsequently, the collected data set may be used as input to determine a causality between temperature, humidity and the like at various locations in the area and whether the control system is abnormal.
For the sake of description below, how to determine whether the control system is abnormal is used as a specific example for illustrating a determination of the causality in the context of the present disclosure. According to other implementations of the present disclosure, the technical solution of the present disclosure may be applied in more application environments. For example, in an application environment for determining a causality between sales of a specific product (e.g., beer) and variables (the price of beer, temperature, time, country and other information), a data set comprising sales and various other variables may be collected, and then the causality between sales of beer and other variables may be determined based on the data set. In another example, in an application environment for determining a causality between a car insurance premium and variables (e.g., the car's brand, model and airbag number, gender and age of the insurance applicant, etc.), a data set comprising the insurance premium and the various other variables may be collected, and then the causality between the insurance premium and the other variables may be determined based on the data set.
In the context of the present disclosure, the Bayesian network is used as one specific example of a causality to describe specific details of the present disclosure. Here, the
Bayesian network is a graphical probabilistic network model defined based on a directed graph. The directed graph may be presented using a matrix. Specifically, suppose in the application environment for determining whether the control system is abnormal, there exist the following p variables: temperature, humidity, . . . , whether the control system is abnormal. At this point, a data set comprising n samples may be represented as Table 1.
As shown in Table 1, the first column “variable x1=temperature” indicates that the first variable among p variables is “temperature,” that is, temperature values measured at different time points. The second column “variable x2=humidity” indicates that the second variable among p variables is “humidity,” that is, humidity values measured at different time points. The last column “variable xp=being abnormal” indicates that the pth variable among p variables is “being abnormal or not,” that is, whether the control system is abnormal at different time points. Causalities between the above p variables may be represented using a matrix B as below.
For example, matrix B is a p-order matrix including p×p elements, each element indicates whether there is a causality between two variables corresponding to a location of the element. Specifically, the variable βji in the matrix B represents a causality between the jth variable and the ith variable among p variables. It should be noted that if locations of the two variables differ, then the causality also differs. Therefore, βji and βij represent different causalities. In other words, edges in the directed graph represented by the matrix B have different directions. Moreover, a diagonal in the matrix B represents causalities between each element and itself. However, there is no causality between a specific element and itself, a value of the element at the diagonal should be set to 0.
As seen from the above description, in the Bayesian network, the problem for determining causalities between p variables based on a collected data set may be converted into a procedure for solving a matrix describing causalities between a plurality of elements. By now technical solutions have been proposed to solve a matrix by building problem formulas based on a data set and expert knowledge. However, existing technical solutions impose requirements that are too harsh on expert knowledge, and it is difficult to obtain expert knowledge that meets such harsh requirements.
For example, in one technical solution, expert knowledge not only needs to describe whether there is causality between two variables, but also has to describe the probability that the two variables have the causality between them. It is understood that expert knowledge is still limited and incomplete in most of existing application environments. For example, in the above application environment for determining the car insurance premium, there may only exist the following limited expert knowledge: the gender and age of the insurance applicant have no direct causality, and the airbag number and the car insurance premium have direct causality, etc. In existing technical solutions based on expert knowledge, such limited expert knowledge cannot provide all necessary information, and thereby cannot be used to help the causality determination.
To solve drawbacks in the above technical solutions, according to one implementation of the present disclosure, a method is proposed for determining a causality between a plurality of variables. In the technical solution, a concept of expert knowledge constraints is introduced during building problem formulas. Here, the expert knowledge constraint comprises two types of constraint: 1) an edge constraint on a direct causality between two variables in a matrix describing a directed graph; and 2) a path constraint on an indirect causality between two variables in the matrix.
It should be noted that according to one implementation of the present disclosure, edge constraints and path constraints are determined based on existing (perhaps incomplete) expert knowledge. Therefore, according to the present disclosure, it is possible to easily and effectively help the causality determination between a plurality of variables by means of expert knowledge, without a need for complete expert knowledge for the plurality of variables.
Specifically, according to one implementation of the present disclosure, a method is proposed for determining a causality between a plurality of variables. The method comprises: in response to a data set of a plurality of samples associated with the plurality of variables being collected, obtaining a matrix that describes the causality between the plurality of variables, each sample among the plurality of samples comprising data that corresponds to the plurality of variables; determining a fitness degree and an expert knowledge constraint associated with the causality based on the data set and the matrix, where the expert knowledge constraint comprises at least one of an edge constraint on a direct causality between two variables in the matrix and a path constraint on an indirect causality between two variables in the matrix; building a problem formula that describes the causality according to the determined fitness degree and expert knowledge constraint; and solving the built problem formula so as to obtain a candidate result of the matrix.
With reference to
As shown by arrows 254 and 256, a fitness degree 230 and an expert knowledge constraint 232 which are associated with the causality are determined based on the data set 210 and the matrix 220. The expert knowledge constraint 232 comprises at least one of an edge constraint on a direct causality between two variables in the matrix and a path constraint on an indirect causality between two variables in the matrix. As shown by arrows 258 and 260, a problem formula 240 describing the causality may be built based on the determined fitness degree 230 and expert knowledge constraint 232. Finally, as shown by the arrow 262, the built problem formula 240 is built to obtain a candidate result of the matrix 220. At this point, the candidate result represents a specific value of each element in the matrix 220.
Here, the data set 210 is a set of sample data which is collected in an application environment. For example, in the above application environment for determining whether the control system is abnormal, the data set 210 may be the data set shown in Table 1, where each row represents one sample. Each sample comprises measured values of p variables x1, x2, . . . , xp. At this point, a matrix 220 (e.g., matrix B described above) describing the causality between the p variables may be obtained. It should be noted that the value of each element in the matrix 220 is unknown here, but it may be considered that values of variables are unknown numbers. In subsequent steps, a problem formula may be built and solved so as to obtain the candidate result of the matrix (i.e., the value of each element in the matrix). Since the causality between the plurality of variables is described by the matrix 220, the candidate result of the matrix represents the causality.
At block 320, a fitness degree 230 and an expert knowledge constraint 232 which are associated with the causality are determined based on the data set 210 and the matrix 220, where the expert knowledge constraint 232 comprises at least one of an edge constraint on a direct causality between two variables in the matrix and a path constraint on an indirect causality between two variables in the matrix.
The matrix 220 may be provided in the form of matrix B, where the matrix 220 may comprise p vectors each of which is as shown by one row in the matrix 220. For brevity of the description, specific details according to one implementation of the present disclosure will be illustrated by taking a three-dimensional matrix where p=3 as a specific example of the matrix describing the causality. At this point, the data set 210 may be represented as Table 2.
When p=3, the matrix may be represented as:
At this point, various vectors in matrix M are shown as below:
The first vector: β1=[0 β1,2 β1,3];
The second vector: β2=[β2,1 0 β2,3];
The third vector: β3=[β3,1 β3,2 0].
According to implementations of the present disclosure, the fitness degree 230 and the expert knowledge constraint 232 may be determined for each vector among the plurality of vectors in the matrix. Detailed description will be presented with reference to specific formulas. At block 330, the problem formula 240 describing the causality may be built according to the determined fitness degree 230 and expert knowledge constraint 232. At block 340, the built problem formula 240 is solved so as to obtain the candidate result of the matrix 220. It should be noted that here the candidate result comprises values of various elements in the matrix 220. By means of the candidate result, the matrix 220 describing the causality between the plurality of variables may be obtained, and further a directed graph about relationships between variables may be obtained. Since the matrix 220 comprises the plurality of vectors β1, β2 and β3, a fitness degree and an expert knowledge constraint may be determined for each vector, respectively.
According to one implementation of the present disclosure, the edge constraint and the path constraint may be set for a direct causality and an indirect causality between two variables in the matrix, respectively. The concepts of the direct causality and indirect causality will be described with reference to
For example, the directed edge 460 pointing to the node 450 from the node 410 indicates that variable x1 has a direct causality with variable xp, in other words, variable x1 is a direct reason of variable xp. In the directed graph 400, a path comprises a series of edges and indicates that two nodes at two ends of the path have an indirect causality with them. Specifically, there are two paths from the node 410 to the node 450, among which the first path comprises the edges 470, 468 and 466 and the second path comprises the edges 462 and 464. Here, the two paths indicate that there is an indirect causality between the variable x1 represented by the node 410 and the variable xp represented by the node 450. Here, the number of edges comprised in a path may be referred to as path length. For example, the first path has a length of 3, and the second path has a length of 2.
Description is presented below on how to build a problem formula with reference to a specific example. According to one implementation of the present disclosure, the problem formula may comprise the fitness degree and expert knowledge constraint associated with the causality. Since the matrix 220 comprises the plurality of vectors β1, β2 and β3, a fitness degree and an expert knowledge constraint may be determined for each vector. According to one implementation of the present disclosure, the problem formula may be built using Formula 1 below:
In Formula 1, βj represents a current vector among the plurality of vectors in the matrix, Fitnessj and Constraintj represent a fitness degree and an expert knowledge constraint for the current vector βj, respectively. In this implementation, Fitnessj and Constraintj are both associated with the current vector βj. Formula 1 may be solved so as to obtain a value that causes the problem formula to have a minimum value, and the value may be used as a candidate result of the current vector βj. In this way, by solving with respect to each vector among the plurality of vectors in the matrix 220, values of various elements in the matrix 220 may be obtained.
Since the operation on each vector among the plurality of vectors is similar, one vector is taken as a specific example for describing details according to one implementation of the present disclosure. Specifically, with respect to the current vector βj among the plurality of vectors in the matrix 220, a fitness degree and an expert knowledge constraint may be determined for the current vector βj, respectively.
Regarding each vector in the matrix, the fitness degree indicates a fitness relationship between a current column corresponding to the current vector βj and other columns in the data set. According to one implementation of the present disclosure, Fitnessj for the current vector βj may be determined based on a 2-norm operation. Specifically, Fitnessj for the current vector βj may be determined based on Formula 2 as below:
Fitnessj=∥xj−x−jβj∥22 Formula 2
In Formula 2, xj represents a portion associated with the current vector βj among the plurality of samples in the data set 210, x−j represents a represents a portion associated with vectors other than the current vector βj among the plurality of samples, βj represents the current vector, and ∥ ∥22 represents a 2-norm operation. For example, when j=1, xj represents values T1, T2, . . . , Tn in the first column of “variable x1=temperature” in the data set shown by Table 1; and x−j represents values in columns other than the first column in the data set shown by Table 1 (e.g., M1, M2, . . . , Mn in the second column of “variable x2=humidity”, and E1, E2, . . . , En in the p column of “variable xp=being abnormal”).
In Formula 2, ∥xj−x−jβj∥22 represents a fitness degree associated with the current vector βj, the fitness degree indicating a fitness relationship between the current column and another column in the matrix. The fitness degree is denoted in a 2-norm form, which may represent the fitness degree between xj and x−jβj. The smaller is the value of ∥xj−x−jβj∥22, the higher is the fitness degree between them; and vice versa.
Description is presented on how to determine the edge constraint and the path constraint with reference to a specific example. According to one implementation of the present disclosure, an edge constraint matrix of a state of a direct causality between two variables among the plurality of variables may be determined based on expert knowledge; and the edge constraint may be determined based on the edge constraint matrix and the matrix.
In this implementation, the expert knowledge may comprise various factors. For example, in the application environment for determining whether the control system is abnormal, the expert knowledge may indicate: there is a direct causality between variable x1 (temperature) and variable xp (being abnormal); there is an indirect causality between variable x2 (humidity) and variable xp (being abnormal). At this point, the edge constraint in the directed graph for the matrix may be determined based on the above direct and indirect causality.
As compared with existing technical solutions for helping the causality determination based on expert knowledge, exact expert knowledge is not required in the context of the present disclosure. For example, expert knowledge only needs to generally indicate whether there is a causality between two variables, without a need for more description of the causality (e.g., without a need for a specific probability). In addition, after determining the edge constraint and the path constraint based on the expert knowledge, there is no need for extra interaction. Therefore, according to one implementation of the present disclosure, the requirement on completeness of the expert knowledge may be lowered, and it is possible to easily and effectively help the causality determination without extra interaction with experts.
Description is presented on how to determine various matrices involved in
In Formula 3, if the expert knowledge indicates a first variable (e.g., variable xj) and a second variable (e.g., variable xi) associated with an element have a direct causality, then the element kji is set as satisfying a first condition (e.g., 1); in response to the expert knowledge indicating that the first variable and the second variable do not have a direct causality, the element kji is set as satisfying a second condition; and in response to the expert knowledge including no knowledge on a direct causality between the first variable and the second variable, the element kji is set as satisfying a third condition (e.g., −1).
According to one implementation of the present disclosure, a path knowledge matrix describing states of the indirect causality between two variables among the plurality of variables may be determined based on the expert knowledge. Specifically, each element aji in the path knowledge matrix A may be determined based on Formula 4 as below.
In Formula 4, if the expert knowledge indicates a first variable (e.g., variable xj) and a second variable (e.g., variable xi) associated with an element have an indirect causality, then the element is set as satisfying a first condition (e.g., 1); in response to the expert knowledge indicating that the first variable and the second variable do not have an indirect causality, the element is set as satisfying a second condition; and in response to the expert knowledge including no knowledge on an indirect causality between the first variable and the second variable, the element is set as satisfying a third condition (e.g., −1).
It should be noted that although the elements kji and aji are set to 1, 0 and −1 under different conditions in the above formulas, in other specific implementations, the element kji may further be set as satisfying other first, second and third conditions, as long as the three different conditions can be differentiated.
Detailed description has been presented on how to determine the edge knowledge matrix K and the path knowledge matrix A based on the expert knowledge. Next, an edge constraint matrix may be determined based on the edge knowledge matrix K and the path knowledge matrix A. Description is presented below on how to determine various elements in the edge knowledge matrix and the path knowledge matrix based on the edge knowledge matrix K and the path knowledge matrix A with reference to
As shown by the second column (kji=0) in the block diagram 600, if the element kji in the edge knowledge matrix K which corresponds to the element {tilde over (w)}ji satisfies the second condition (equaling 0), then the element {tilde over (w)}ji in the edge constraint matrix {tilde over (W)} is set to a larger value. It will be understood that although a specific example of the larger value is infinitely large as shown in
As shown by the third column (kji=1) in the block diagram 600, if the element kji in the edge knowledge matrix K which corresponds to the element {tilde over (w)}ji satisfies the first condition (e.g., equaling 1), the element {tilde over (w)}ji in the edge constraint matrix {tilde over (W)} is set to zero.
As shown by the fourth column (kji=−1) in the block diagram 600, if the element kji in the edge knowledge matrix K which corresponds to the element {tilde over (w)}ji satisfies the third condition, the element {tilde over (w)}ji in the edge constraint matrix {tilde over (W)} is set to be associated with the corresponding element βji in the matrix B.
According to one implementation of the present disclosure, the element {tilde over (w)}ji at the location (j, i) in the edge constraint matrix {tilde over (W)} may be determined based on Formula 5 as below.
{tilde over (w)}
ji=|ρjiols|−γ Formula 5
In Formula 5, ρjiols is a predefined super-parameter calculated based on the data set, ols denotes a least square operation, | | denotes an absolute value operation, and γ denotes a predetermined parameter. In this implementation, a value of γ may be determined based on requirements of a specific application environment. Those skilled in the art may determine a value of ρjiols based on related definitions in the prior art, which will not be detailed in implementations of the present disclosure.
According to one implementation of the present disclosure, according to relationships shown in
As shown by the third row (aji=1) in the block diagram 600, if the element aji in the path knowledge matrix A which corresponds to the element ŵji satisfies the first condition (e.g., equaling 1), the element ŵji in the path constraint matrix Ŵ is set to zero.
As shown by the fourth row (aji=−1) in the block diagram 600, if the element aji in the path knowledge matrix A which corresponds to the element ŵji satisfies the third condition, the element ŵji in the path constraint matrix Ŵ is set to 1.
It should be noted that the block diagram 600 further shows the symbol “N.A.”, and this symbol represents such a case is impossible. For example, with reference to an intersection between the second row (aji=−1) and the third column (kji=1) in the block diagram 600, the intersection represents that the expert knowledge does not include knowledge on an edge relationship between the two variables xj and xi, whereas the expert knowledge indicates there is a path between the two variables xj and xi, which contradicts the definition of building the edge knowledge matrix and the path knowledge matrix. Therefore, “N.A.” is used to represent that such a case is impossible.
According to one implementation of the present disclosure, in order to determine a path constraint in the directed graph represented by the matrix, first a path matrix describing a path between two variables among the plurality of variables may be determined based on the matrix; next, the path constraint may be determined based on the path knowledge matrix, the path matrix and the matrix.
In this implementation, the procedure for generating a path based on a plurality of edges in the directed graph will be involved during determining the path constraint in the directed graph represented by the matrix. Therefore, the path constraint matrix Ŵ describing the state of indirect causality between two variables among the plurality of variables may be determined based on the expert knowledge, and then the path constraint may be determined based on the path constraint matrix Ŵ and the matrix.
Specifically, the element βji in the matrix represents an element at the location (j, i) in the matrix, that is, βji represents the direct causality between the variables xj and xi among the plurality of variables. In order to obtain the indirect causality between two variables among the plurality of variables, the matrix may be subjected to a continued multiplication operation so as to obtain the indirect causality between two variables whose path length is larger than 1.
Description is presented on how to determine path matrices associated with paths with different lengths. According to one implementation of the present disclosure, paths with lengths K=2, 3, . . . , p−1 may be determined one by one. Specifically, a K-length path matrix associated with K-length paths may be determined, where the K-length path matrix represents a state of a K-length path between two nodes in the directed graph associated with the matrix, where K≤p−1, and p represents the number of the plurality of variables; and the path matrix may be determined based on the K-length path matrix.
Suppose K=2, then at this point a “2-length path matrix” may be determined based on continued multiplications of the above matrix B. Specifically, the 2-length path matrix may be determined based on B×B. According to one implementation of the present disclosure, the K-length path matrix associated with the path length K may be determined based on K multiplications of the matrix B. For the sake of description, the K-length path matrix may be denoted as MK, and the K-length path matrix may be determined based on Formula 6 as below:
M
K=Πk−1Kabs(B) Formula 6
In Formula 6, Πk=1K denotes K continued multiplications, abs(B) denotes an absolute value of the matrix B.
According to one implementation of the present disclosure, where the K-length path matrix MK has been obtained, a sum of the obtained various K-length path matrices MK may be calculated so as to obtain a path matrix P describing paths with various lengths between two variables in the directed graph. Specifically, the path matrix P may be determined based on Formula 7 as below.
P=Σk=1p−1MK Formula 7
The element pji at the location (j, i) in the matrix P may be calculated based on Formula 8 as below:
pji=Σk=1p−1mjiK Formula 8
According to one implementation of the present disclosure, the problem formula associated with the current vector βj may be built based on Formula 9 as below:
In Formula 9, βj denotes the current vector, {tilde over (w)}j denotes a portion associated with the current vector in the edge constraint matrix, ∥xj,−βjx−j,∥22 denotes the fitness degree associated with the current vector βj, xj denotes a portion associated with the current vector βj among the plurality of samples, x−j denotes a portion associated with vectors other than the current vector βj among the plurality of samples, and
denotes a constraint condition, where {tilde over (c)} is a predetermined parameter.
At this point, the expert knowledge constraint comprises an edge constraint vector and a path constraint vector associated with the current vector βj in the matrix, where the edge constraint vector is
and the path constraint vector is
In the context of the present disclosure, since it is desirable to describe the determined causality via the directed acyclic graph, a constraint condition may further be set so as to guarantee that no cycle is in the matrix. A variable among the plurality of variables may be considered one by one by building a causal sequence, so different causal sequences may be formed in order to achieve a target state.
f(Qs)=g(Qs)+h(Qs) Formula 10
In Formula 10, f(Qs) denotes a score of reaching the target state from the state associated with the current causal sequence QS, g(Qs) denotes a score of reaching the state associated with the current causal sequence QS (as shown by the node 720) from an initial state (a null set as shown by a node 710), and h(Qs) denotes a predicted score of reaching the target state from the state associated with the current causal sequence QS.
As shown in
In Formula 11, Π<jQ
Furthermore, the above formula includes constraints associated with an edge and associated with a path, respectively, so these two constraints may be set as different values. At this point, by setting the constraint associated with a path in Formula 11 as a different value, Formula 12 may be obtained as below:
In Formula 12, Π>iQ
denotes a constraint associated with an edge, and
denotes a constraint associated with a path.
According to one implementation of the present disclosure, by performing a solution based on Formula 12, candidate results of various vectors in the matrix may be obtained. It should be noted that values of various elements in the matrix may be determined using a solution algorithm that is known in the prior art or that will be developed in future. In Formula 12, the edge constraint and the path constraint based on the expert knowledge have been introduced, so the existing expert knowledge may be utilized to help the causality determination between the plurality of variables. It should be noted that although Formula 12 includes the edge constraint
and the path constraint
according to one implementation of the present disclosure, the problem formula as built may comprise only the edge constraint, only the path constraint, or comprise both the edge constraint and the path constraint.
According to one implementation of the present disclosure, the determining module 820 is further configured to determine an edge constraint matrix of a state of a direct causality between two variables among the plurality of variables based on expert knowledge; and determine the edge constraint based on the edge constraint matrix and the matrix.
According to one implementation of the present disclosure, the determining module 820 is further configured to determine a path constraint matrix of a state of an indirect causality between two variables among the plurality of variables based on expert knowledge; and determine the path constraint based on the path constraint matrix and the matrix.
According to one implementation of the present disclosure, the determining module 820 is further configured to determine a path matrix describing a path between two variables among the plurality of variables based on the matrix; and determine the path constraint based on a path knowledge matrix, the path matrix and the matrix.
According to one implementation of the present disclosure, the determining module 820 is further configured to determine a K-length path matrix associated with a path having a length of K, where the K-length path matrix represents a state of a path having a length of K between two nodes in a directed graph associated with the matrix, where K≤p−1, p represents a number of the plurality of variables; and determine the path matrix based on the K-length path matrix.
According to one implementation of the present disclosure, the determining module 820 is further configured to determine an edge knowledge matrix describing a state of a direct causality between two variables among the plurality of variables based on the expert knowledge; and determine the edge constraint matrix based on the edge knowledge matrix.
According to one implementation of the present disclosure, the determining module 820 is further configured to: with respect to an element in the edge knowledge matrix, set the element as satisfying a first condition in response to the expert knowledge indicating that a direct causality exists between a first variable and a second variable associated with the element; set the element as satisfying a second condition in response to the expert knowledge indicating that no direct causality exists between the first variable and the second variable; and set the element as satisfying a third condition in response to the expert knowledge including no knowledge on a direct causality between the first variable and the second variable.
According to one implementation of the present disclosure, the determining module 820 is further configured to: with respect to an element in the path knowledge matrix, set the element as satisfying a first condition in response to the expert knowledge indicating that an indirect causality exists between a first variable and a second variable associated with the element; set the element as satisfying a second condition in response to the expert knowledge indicating that no indirect causality exists between the first variable and the second variable; and set the element as satisfying a third condition in response to the expert knowledge including no knowledge on an indirect causality between the first variable and the second variable.
According to one implementation of the present disclosure, the determining module 820 is further configured to: with respect to an element in the edge constraint matrix, set the element in the edge constraint matrix to a larger value in response to an element in the edge knowledge matrix, which corresponds to the element, equaling 0; set the element in the edge constraint matrix to zero in response to an element in the edge knowledge matrix, which corresponds to the element, satisfying a first condition; and set the element in the edge constraint matrix as associated with a predefined super-parameter in response to an element in the edge knowledge matrix, which corresponds to the element, satisfying a third condition.
According to one implementation of the present disclosure, the determining module 820 is further configured to: set an element {tilde over (w)}ji at a location (j, i) in the edge constraint matrix as {tilde over (w)}ji=|ρjiols|−γ, where ρjiols is a predefined super-parameter calculated based on the data set, ols represents a least square operation, | | represents an absolute value operation, and γ represents a predetermined parameter.
According to one implementation of the present disclosure, the determining module 820 is further configured to determine a path knowledge matrix describing a state of an indirect causality between two variables among the plurality of variables based on the expert knowledge; and determine the path constraint matrix based on the path knowledge matrix.
According to one implementation of the present disclosure, the determining module 820 is further configured to: with respect to an element in the path constraint matrix, set the element in the path constraint matrix to a larger value in response to an element in the path knowledge matrix, which corresponds to the element, equaling 0; set the element in the path constraint matrix to zero in response to an element in the path knowledge matrix, which corresponds to the element, satisfying a first condition; and set the element in the path constraint matrix to 1 in response to an element in the path knowledge matrix, which corresponds to the element, satisfying a third condition.
According to one implementation of the present disclosure, the edge constraint vector is
and the path constraint vector is
According to one implementation of the present disclosure, the building module 830 is further configured to build a problem formula vector for the current vector βj:
where Supp(βj) represents a support of the current vector βj, QS represents a causal sequence associated with at least one part of the plurality of elements, xj represents a portion associated with the current vector βj among the plurality of samples, x−j represents a portion associated with vectors other than the current vector βj among the plurality of samples, ∥ ∥22 represents a 2-norm operation, {tilde over (w)}ji represents an element at a location (j, i) in the edge constraint matrix, βji represents an element at a location (j, i) in the matrix, ŵji represents an element at a location (j, i) in the path constraint matrix, pvi represents an element at a location (j, i) in the path matrix, βjv represents an element at a location (j, v) in the matrix, | | represents an absolute value operation, and Π>iQ
According to one implementation of the present disclosure, the built problem formula vector is solved so as to obtain a candidate result of the current vector βj of the matrix.
According to one implementation of the present invention, a system is provided for determining a causality between a plurality of variables, the system comprising: one or more processors; a memory coupled to at least one processor of the one or more processors; computer program instructions stored in the memory which, when executed by the at least one processor, cause the system to execute a method for determining a causality between a plurality of variables. The method comprises: in response to a data set of a plurality of samples associated with the plurality of variables being collected, obtaining a matrix describing the causality between the plurality of variables, each sample among the plurality of samples comprising data that corresponds to the plurality of variables; determining a fitness degree and an expert knowledge constraint which are associated with the causality based on the data set and the matrix, where the expert knowledge constraint comprises at least one of an edge constraint on a direct causality between two variables in the matrix and a path constraint on an indirect causality between two variables in the matrix; building a problem formula describing the causality according to the determined fitness degree and expert knowledge constraint; and solving the built problem formula so as to obtain a candidate result of the matrix.
According to one implementation of the present disclosure, determining the expert knowledge constraint comprises determining the edge constraint, which comprises: determining an edge constraint matrix of a state of a direct causality between two variables among the plurality of variables based on expert knowledge; and determining the edge constraint based on the edge constraint matrix and the matrix.
According to one implementation of the present disclosure, determining the expert knowledge constraint comprises determining the path constraint, which comprises: determining a path constraint matrix of a state of an indirect causality between two variables among the plurality of variables based on expert knowledge; and determining the path constraint based on the path constraint matrix and the matrix.
According to one implementation of the present disclosure, determining the path constraint based on the path constraint matrix and the matrix comprises: determining a path matrix describing a path between two variables among the plurality of variables based on the matrix; and determining the path constraint based on a path knowledge matrix, the path matrix and the matrix.
According to one implementation of the present disclosure, determining the path matrix comprises: determining a K-length path matrix associated with a path having a length of K, where the K-length path matrix represents a state of a path having a length of K between two nodes in a directed graph associated with the matrix, where K≤p−1, p represents the number of the plurality of variables; and determining the path matrix based on the K-length path matrix.
According to one implementation of the present disclosure, determining the edge constraint matrix comprises: determining an edge knowledge matrix describing a state of a direct causality between two variables among the plurality of variables based on the expert knowledge; and determining the edge constraint matrix based on the edge knowledge matrix.
According to one implementation of the present disclosure, determining the edge knowledge matrix comprises: with respect to an element in the edge knowledge matrix, setting the element as satisfying a first condition in response to the expert knowledge indicating that a direct causality exists between a first variable and a second variable associated with the element; setting the element as satisfying a second condition in response to the expert knowledge indicating that no direct causality exists between the first variable and the second variable; and setting the element as satisfying a third condition in response to the expert knowledge including no knowledge on a direct causality between the first variable and the second variable.
According to one implementation of the present disclosure, determining the path knowledge matrix comprises: with respect to an element in the path knowledge matrix, setting the element as satisfying a first condition in response to the expert knowledge indicating that an indirect causality exists between a first variable and a second variable associated with the element; setting the element as satisfying a second condition in response to the expert knowledge indicating that no indirect causality exists between the first variable and the second variable; and setting the element as satisfying a third condition in response to the expert knowledge including no knowledge on an indirect causality between the first variable and the second variable.
According to one implementation of the present disclosure, determining the edge constraint matrix based on the edge knowledge matrix comprises: with respect to an element in the edge constraint matrix, setting the element in the edge constraint matrix to a larger value in response to an element in the edge knowledge matrix, which corresponds to the element, equaling 0; setting the element in the edge constraint matrix to zero in response to an element in the edge knowledge matrix, which corresponds to the element, satisfying a first condition; and setting the element in the edge constraint matrix as associated with a predefined super-parameter in response to an element in the edge knowledge matrix, which corresponds to the element, satisfying a third condition.
According to one implementation of the present disclosure, setting the element in the edge constraint matrix as associated with the predefined super-parameter comprises: setting an element {tilde over (w)}ji at a location (j, i) in the edge constraint matrix as {tilde over (w)}ji=|ρjiols|−γ, where ρjiols is a predefined super-parameter calculated based on the data set, ols represents a least square operation, | | represents an absolute value operation, and γ represents a predetermined parameter.
According to one implementation of the present disclosure, determining the path constraint matrix comprises: determining the path knowledge matrix describing a state of an indirect causality between two variables among the plurality of variables based on the expert knowledge; and determining the path constraint matrix based on the path knowledge matrix.
According to one implementation of the present disclosure, determining the path constraint matrix based on the path knowledge matrix: with respect to an element in the path constraint matrix, setting the element in the path constraint matrix to a larger value in response to an element in the path knowledge matrix, which corresponds to the element, equaling 0; setting the element in the path constraint matrix to zero in response to an element in the path knowledge matrix, which corresponds to the element, satisfying a first condition; and setting the element in the path constraint matrix to 1 in response to an element in the path knowledge matrix, which corresponds to the element, satisfying a third condition.
According to one implementation of the present disclosure, the expert knowledge constraint comprises an edge constraint vector and a path constraint vector which are associated with a current vector βj in the matrix, where the edge constraint vector is
and the path constraint vector is
According to one implementation of the present disclosure, building the problem formula describing the causality comprises: building a problem formula vector for the current vector βj:
where Supp(βj) represents a support of the current vector βj, QS represents a causal sequence associated with at least one part of the plurality of elements, xj represents a portion associated with the current vector βj among the plurality of samples, x−j represents a portion associated with vectors other than the current vector βj among the plurality of samples, ∥ ∥22 represents a 2-norm operation, {tilde over (w)}ji represents an element at a location (j, i) in the edge constraint matrix, βji represents an element at a location (j, i) in the matrix, ŵji represents an element at a location (j, i) in the path constraint matrix, pvi represents an element at a location (j, i) in the path matrix, βjv represents an element at a location (j, v) in the matrix, | | represents an absolute value operation.
According to one implementation of the present disclosure, solving the built problem formula so as to obtain the candidate result of the matrix comprises: solving the built problem formula vector so as to obtain a candidate result of the current vector βj of the matrix.
According to one implementation of the present disclosure, a computer program product is provided. The computer program product is tangibly stored on a non-transitory computer-readable medium and comprises machine-executable instructions which, when executed, cause a machine to implement steps of the method described above.
The various implementations implementing the method of the present invention have been described with reference to the accompanying drawings. Those skilled in the art may appreciate that the method may be implemented in software, hardware or a combination thereof. Moreover, those skilled in the art may appreciate that a device based on the same inventive concept may be provided by implementing respective steps of the method in software, hardware or combination of software and hardware. Even if the device is the same as a general-purpose processing device in hardware structure, the functionality of software contained therein makes the device exhibit distinguishing characteristics over the general-purpose processing device, thereby forming a device according to the various embodiments of the present invention. The device of the present invention comprises several means or modules, which are configured to execute corresponding steps. By reading this specification, those skilled in the art may understand how to write a program to implement actions performed by the means or modules. Since the device and the method are based on the same inventive concept, like or corresponding implementation details also apply to the means or modules corresponding to the method. Since a detailed and complete description has been presented above, details may be ignored below.
The flow charts and block diagrams in the drawings illustrate system architecture, functions and operations that may be implemented by system, method and computer program products according to a plurality of implementations of the present disclosure. In this regard, each block in the flow chart or block diagram can represent a module, a part of program segment or code, where the module and the part of program segment or code include one or more executable instructions for performing stipulated logic functions. In some alternative implementations, it should be noted that the functions indicated in the block can also take place in an order different from the one indicated in the drawings. For example, two successive blocks can be in fact executed in parallel or sometimes in a reverse order depending on the functions involved. It should also be noted that each block in the block diagram and/or flow chart and combinations of the blocks in the block diagram and/or flow chart can be implemented by a hardware-based system exclusive for executing stipulated functions or actions, or by a combination of dedicated hardware and computer instructions.
Various implementations of the present disclosure have been described above and the above description is only exemplary rather than exhaustive and is not limited to the implementations of the present disclosure. Many modifications and alterations, without deviating from the scope and spirit of the explained various implementations, are obvious for those skilled in the art. The selection of terms in the text aims to best explain principles and actual applications of each implementation and technical improvements made in the market by each implementation, or enable others of ordinary skill in the art to understand implementations of the present disclosure.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2019/080250 | 3/28/2019 | WO | 00 |