Abstract:
For mining causality rules in an event database, the rules are obtained by iteratively generating candidate rules and counting their occurrences in the event database. Newly identified causality rules are used to generate the next set of candidate rules to be evaluated, by increasing the size of the set of consequential events triggered by triggering events and/or the number of triggering events. The preferred embodiment uses an iterative approach to deriving the causality rules in order of the consequential set sizes and triggering set sizes. The detection of an occurrence of a causality rule in an event sequence is handled as a sub-sequence matching problem using a novel hierarchical matching method to improve efficiency.

Description:
FIELD OF THE INVENTION 
     This invention relates to mining of causality rules from an event database, where each event may belong to multiple categories and the causality rule consists of a sequence of triggering events and a set of consequential events occurring in random order after the triggering events. The data mining can be applied to improve electronic commerce applications; for example, by identifying consumer telephone calling patterns and consumer buying patterns, with the mined information being applied to more effective on-line presentation of advertising and offerings to the consumers. 
     BACKGROUND OF THE INVENTION 
     Data mining has been developed to derive meaningful information from the large volumes of customer data which is currently gathered in the monitoring of telephone calling, credit card transactions, random surveys, etc. Deriving demographic trends from the volumes of material can assist marketers in focussing their advertising and promotions toward that segment of the population which is most likely to buy their product. In the arena of electronic commerce, the effective presentation of on-line advertising and offerings is integral for reaching the target audience. General broadcasting of advertising is wasteful, and frequently counterproductive. Therefore, it is desirable to tailor on-line advertising not only in content but also in distribution. 
     One emerging area of importance is the development of electronic directories, such as the Yellow Pages. The directory providers, primarily telecommunications companies, have been exploring alternatives to publishing their directories solely in book form. Alternative media include CD-ROM, audiotex with fax, on-line services, and interactive television. In addition to providing the directory pages (with the extensive advertising generally found therein) along the alternative media, the companies can serve as providers of transaction services in those media, which services would be facilitated by bundling of related advertising on their pages. A challenge is to design electronic presentations of relevant items based upon the users&#39; past transaction patterns to maximize advertising efficiencies and sales. 
     Transaction patterns can be derived from collected data by observing customer behavior in terms of cause and effect, or what will be referred to herein as triggering events and consequential events. Hereinafter, the term &#34;causality rule(s)&#34; will refer to a means for describing certain customer behavior where some triggering event leads to a set of consequential events. For example, the purchase of a new car may start with calls and visits to car dealers, followed by calling to make inquiries about car insurance, auto loans, and prices for various automobile accessories. The triggering event would be calling/visiting the car dealer, with the consequential events being the calls to make inquiries into loans, insurance and accessories. No specific order is assumed among the consequential events. In mining causality rules, certain constraints such as time may additionally be applied. For example, it may be reasonable to require that all consequential events occur within a certain period after the triggering event has transpired. One can view the time constraint as a moving window on deciding causality rules or as the setting of an upper bound on the time gap between two successive events in a causality rule. 
     With respect to tracking telephone calls, in all of the telecommunications companies, a customer database is maintained having records of all phone calls made by each customer. The information gathered includes the customer id, the telephone number called, the start time of the call and the duration of the call. It can be assumed that one attempting to gather demographic information from such a database is only interested in calls made to business establishments whose numbers, and advertising, would ordinarily appear in the directory pages. Each business phone number would ideally be mapped into a corresponding directory page business category. The mapping may be 1:1 or 1:n where n&gt;1, since a business may logically be listed under multiple categories in the directory pages. One would then like to map the list of business phone calls from each customer into a sequence of business events and/or sets of events indicated by the corresponding directory page categories of the events. 
     Another example would be that of consumer buying patterns. From a credit card transaction database, one would like to obtain the sequence of items bought by each customer, including the date and time of each purchase, the customer id, the item purchased, the price of the item, and possibly the identity of other items purchased at the same time. It would be desirable to then map the items into product categories applying mining rules such as discussed above. 
     The type of problem can be understood by reference to the following model. Given a sequence database of n sequences (s j , 1≦j≦n). For any sequence s j  =a j1 ,a j2 , . . . ,a jk , each element a ji  can either be a basic (i.e., single) event or a set of basic events. In the latter case, a ji  is referred to as a composite event. A simple sequence consists of only basic events. A sequence b j1 ,b j2 , . . . ,b jh  is contained in another sequence d j1 ,d j2 , . . . ,d jk  if (1) for each b ji  there exists either a simple event d jm  matching it or a composite event d ji  containing it and (2) for i&lt;k the event matching/containing b jk  in d j1 ,d j2 , . . . ,d jk  must follow the event matching/containing b ji . 
     We regard &#34;c 1  triggers (r 1 , . . . ,r k )&#34; as a causality rule, if there is a sufficient number of sequences in the database containing c 1  followed by the r j  &#39;s, (1≦j≦k) in any order and the c 1 ,r 1 , . . . , and r k , satisfy some pre-specified constraints (like the aforementioned time constraint). This causality rule can be generalized to allow for a sequence of triggering events to lead to a set of consequential events. That is to say, &#34;(c 1 , . . . ,c m ) triggering (r 1 , . . . ,r k )&#34; may be regarded as a causality rule, if there is a sufficient number of sequences containing (c 1 , . . . ,c m ) followed by the r j  &#39;s, (1≦j≦k) in any order, and furthermore that c 1 , . . . c m , and r 1 , . . . , and r k , satisfy some pre-specified constraints. 
     In an article entitled &#34;Mining Association Rules between Sets of Items in Large Databases&#34; by R. Agrawal, et al, Proc. ACM Conference on Management of Data (1993), the authors consider the problem of mining association rules. An example of an association rule might be that 98 percent of customers that purchase milk and bread also purchase eggs at the same time. Association rules deal with buying patterns within a transaction. All purchases in a transaction are treated as occurring at the same time. There is no concept of before or after (i.e., cause and effect or trigger and consequence). 
     Two other references which provide approaches to mining association rules include: &#34;Fast Algorithms for Mining Association Rules&#34; by R. Agrawal et al, Proc. Conference on Very Large Data Bases (1994), which attempts to apply improved algorithms to mining association rules; and &#34;Set-Oriented Mining for Association Rules in Relational Databases&#34; by M. Houtsma, et al, IEEE Conf. on Data Engineering (1995), which discusses the use of set-oriented query language (SQL) for mining association rules. 
     Association rules, as noted above, deal with intra-transaction information, the events in which have occurred effectively simultaneously, with no regard for cause and effect or trigger and consequence. Causality rules, on the other hand, deal with inter-transaction behavior. The triggering event must occur earlier in time than all of the consequential events. Furthermore, causality rules deal with events at the category level and allow each event to appear in multiple categories. 
     Mining of sequential events has been studied in &#34;Mining Sequential Patterns&#34; by R. Agrawal, et al, IEEE Conf. on Data Engineering (1995). Sequential events are inter-transaction events which are necessarily ordered in time, such that a second event always follows the first, and a third event follows the second, but the third would never directly follow the first. An example of a sequential pattern in a database of a video rental store would be that customers typically rent &#34;The Godfather&#34; first, then &#34;Godfather II&#34;, and then &#34;Godfather III&#34;. 
     Mining of generalized association rules has been studied in &#34;Mining Generalized Association Rules&#34; by R. Srikant and R. Agrawal, Proc. 21st VLDB Conference (1995). In that article, the authors provide a taxonomy (i.e., hierarchy) of items and derive association rules at a given level of the taxonomy. The categorization for causality rules does not form a taxonomy of the sort discussed in the article due to the fact that, in causality situations, each event may belong to multiple categories at the same level. 
     While the teachings of the above-noted articles are relevant to the mining of information in databases in general, none of the approaches is appropriate for mining non-sequential, inter-transaction information across multiple categories of information. 
     It is therefore an objective of the present invention to provide a solution for mining causality rules from an event database, where each event may belong to multiple categories. 
     It is another objective of the invention to provide a method and system for mining non-sequential consequential events which follow from triggering events. 
     SUMMARY OF THE INVENTION 
     For mining causality rules, the rules are obtained by iteratively generating candidate rules and counting their occurrences in the database. Newly identified causality rules are used to generate the next set of candidate rules to be evaluated. The preferred embodiment presented herein uses an iterative approach to deriving the causality rules in order of the consequential set sizes and triggering set sizes. The detection of an occurrence of a causality rule in an event sequence is handled as a sub-sequence matching problem using a hierarchical matching method to improve efficiency. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The invention will now be described in greater detail with reference to the attached drawings wherein: 
     FIG. 1 is a block diagram of a data mining system; 
     FIGS. 2A and 2B provides an illustration of bipartite graphing; 
     FIG. 3 is a generalized process flow diagram of the present inventive method; and 
     FIGS. 4(a) through 4(c) comprise a flow chart of the process for causality rule mining in accordance with a preferred embodiment of the invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     The invention is implemented using a computer system of the type illustrated in FIG. 1. Data mining server 100 as illustrated includes processor 101, disks 102, temporary storage locations 105, and application 106. Clearly, other applications are available to processor 101; however, for the purpose of describing the present invention, only the data mining application 106 is illustrated and discussed. Processor 101 applies the causality rule mining application 106 to information retrieved from permanent storage locations 102, using memory buffers 105 to store the data in process. While the permanent storage is illustrated as disks resident within the server, clearly the information can be stored in alternative storage media, remote or local to the server, provided that the information can be read out of that media by processor 101. The data mining server can be embodied using any processor of sufficient performance capability to handle large amounts of data. For example, a small capacity data mining server could be embodied using a RISC System 6000*, while a larger capacity server could be embodied in an ES/9000* or SP 2* (* trademarks of International Business Machines Corporation, Armonk, N.Y.). 
     Referring to FIG. 3, there is a generalized process flow of the data mining process according to an embodiment of the present invention. In step 200, the transaction database is pre-processed to create an event sequence database, as will be further detailed below, of N sequences, with the ith sequence consisting of G i  events. The preprocessing can consist of a sorting phase, comprising sorting transaction records according to customer id and time, and a mapping phase, comprising mapping each transaction event into related categories. In step 210, the causality rules are derived and evaluated using hierarchical sub-sequence matching, iteratively generating candidate causality rules with increasing consequential set size for matching. 
     Given a customer database of transaction events, (e.g., a database of phone calls with customer id, phone call time, and calling number in each record), the records can be sorted by customer id and time. Thus an event sequence for each customer id can be obtained. Each event in that sequence can be further mapped into its associated category set (e.g., type of business represented by the calling number). Hereinafter, the existence of the event category sequence database is assumed, and the term &#34;event&#34; will apply to &#34;event category.&#34; The problem of mining causality rules can be mapped from an event sequence database into a problem of counting large event sets. Initially, the case will be considered when there is only a single triggering event in each causality rule. The case will then be generalized to one in which a sequence of triggering events is allowed in each rule. 
     A sequence of k simple events, c 1 , r 1 , . . . ,r k-1 , is referred to as a large k-event rule, if there are sufficient numbers of sequences containing c 1  followed by the r j  &#39;s where (1≦j≦k-1) in any order (i.e., its fraction of appearances in the sequence database exceeds a minimum threshold). The set of all large k-event rules forms the large k-event set. A large k-event rule, c 1 ,r 1 , . . . r k-1 , represents a causality rule if the number of sequences containing c 1 ,r 1 , . . . r k-1  exceeds some pre-specified fraction of the total number of sequences containing c 1 . The foregoing is referred to as the confidence requirement of the causality rule. 
     Let L k  represent the large k-event set. Here, without a loss of generality, it will be assumed that for each large k-event rule, c 1 , r 1 , . . . , r k-1 , in L k , the r 1 , . . . ,r k-2 ,r k-1  are in lexicographic order. It is to be noted that L 1  denotes a degenerate case, where each element only represents a frequent event, not a causality rule. Only elements in L 1  can be triggering events or consequential events of a causality rule. First, L 1  is found by scanning the sequence database and keeping a database and keeping a count of the occurrences of each event. For each composite event which is a set of basic events, each of the basic events in the set receives an increment on its count. 
     Starting with k=2, we can then generate a candidate k-event set, C k  from L k-1 . This can be done by joining L k-1  with L k-1  to derive C k . Specifically, for k=2, C 2  is the cross-product of L 1  with itself. For k&gt;2, any two large (k-1)-event rules in L k-1 , with the same starting event and matching k-3 of the remaining events, can be joined together to form a candidate k-event rule in C k . The candidate k-event set will contain the large k-event set as its subset. 
     To count the occurrences in the event sequence database of each candidate k-event rule in C k , it is necessary to scan through the sequence database to do a sub-sequence matching. Here the concept of hierarchical sub-sequence matching is introduced. Instead of comparing each candidate rule in C k  directly with the event sequence in the database, the event sequence is transformed into a simple event sequence and the candidate rules in C k  are compared to the simple event sequence. Only when a match occurs is the original sequence referred to, in order to verify that it is not a false match. The reason for the two step hierarchical matching is for improved efficiency as explained further below. 
     For a sequence S i  in the database, we examine whether each a ij  in the sequence can be a potential triggering event. First a maximum potential set of possible consequential events is determined, including all possible consequential events which can be triggered by a ij  under the pre-specified constraints. The set of possible consequential events is designated as R ij . (For example, if a time constraint from the triggering event is given, R ij  will consist of all of the following events in S i  occurring within the time constraint.) Each composite event in R ij  is replaced by the basic events comprising it. After replacing the composite events, the basic events are then sorted in lexicographic order and the resulting sequence is denoted as Φ ij . 
     Next, the subset of C k  rules that start with a ij  and have their remaining portions matching some sub-sequences contained in Φ ij  is determined. This subset of C k  is referred to as Δ ij . Set R ij  must now be examined to assure that, after discarding its first event, the remaining portion of each candidate rule in Δ ij  is indeed a legitimate sub-sequence in R ij . If so, the count of the corresponding candidate k-event rule in C k  will be incremented. After the scan of the sequence database is completed, those candidate rules in C k  with counts exceeding the threshold will become L k . If L k  is non-empty, the iteration continues with k incremented by 1. 
     In an example of the foregoing, assume that S i  =A,(B,W),D,(U,B),(H,G), . . . , and R i1  =(B,W),D,(U,B),(H,G). Then Φ i1  ={B,D,G,H,U,W}. Consider C 3  ={(A,B,H),(A,G,H),(A,E,W), . . . }. Both (A,B,H) and (A,G,H) start with A, with the remaining portions matching some sub-sequences of Φ i1  ; whereas (A,E,W) does not find a match. Thus Δ i1  ={(A,G,H),(A,B,H)}. By re-examining R i1 , only (A,B,H,) is found to be contained by one of the sub-sequences of S i . It is to be noted that when examining candidate (A,G,H), both G and H come from the same composite event, such that (A,G,H) is not a sub-sequence of S i . 
     The reason for performing the initial matching of C k  with Φ ij  is that matching of two ordered lists is far more efficient than matching two non-ordered lists. The presence of composite events inhibits ordering of the lists, therefore it is desirable to break each composite event into its basic events. However, transforming each composite event into multiple single, or basic, events can create false matching, as with (A,G,H) in the above example. It is recommended, therefore, that an optional step of re-checking, to avoid false matching, be performed if a candidate rule in Δ ij  contains events from composite events. 
     Different approaches can be used to perform the checking. The preferred embodiment is to perform the checking using a bipartite graph matching algorithm as described by R. Sedgewick in Algorithms, 2nd. Edition, Addison-Wesley (Massachusetts, 1988). For each candidate rule matching Φ ij , a bipartite graph is built to map the rule back to the original sequence. In the bipartite graph, one set (Ω 1 ) of vertices consists of events in the candidate rule which are mapped to events in Φ ij  derived from some composite events of the original sequence S i . The other set (Ω 0 ) of vertices consists of the composite events in the original sequence. An edge is introduced between a vertex in Ω 1  and that in Ω 0  if the vertex in Ω 1  belongs to the composite event represented by the vertex in Ω 0 . The problem is to find the maximum matching for the bipartite graph. If all vertices in Ω 1  can find a distinct match, the candidate rule is legitimate. 
     As relates to the above example, consider the case of (A,B,H). The resulting sets are Ω 1  =(B,H), and Ω 0  ={(B,W),(U,B),(G,H)}. The corresponding bipartite graph is shown in FIG. 2(a). If is clear that distinct matches can be found for B and H, for example matching B with (B,W) and H with (G,H). An alternative way of matching is to match B with (U,B) and H with (G,H). For the case of (A,G,H), the resulting sets are Ω 1  ={G,H}, and Ω 0  ={(B,W),(U,B),(G,H)}. The corresponding bipartite graph is shown in FIG. 2(b). Clearly, a unique match for each event in Ω 1  cannot be found, since G and H are basic events which are found as parts of the same composite event in the original set. 
     Finally, the general case is considered where a sequence of triggering events is allowed in each rule. The causality rule of &#34;A and B triggering C&#34; can hold true only if both rules &#34;A triggers C&#34; and &#34;B triggers C&#34; hold. The generalization to a sequence of triggering events is straightforward once all the causality events with a single triggering event have been obtained. Let L i  * be the large i-event set with k triggering events at the beginning of each sequence followed by i-k consequential events. Then L i   1  equal to L i . Starting with j=2 and i=j+1, then L i   j  is obtained from L i-1   j-1 . Specifically, by joining any two rules in L i-1   j-1  with (1) the same consequential set, and (2) the first j-2 triggering events in one of the sequences matching the last j-2 triggering events in the other sequence, a candidate set C i   j  results, with j triggering events. For example, consider two sequences, S 1  and S 2  in L 5   2 . Assuming that S 1  =(A,E,F,H,Y) and S 2  =(E,G,F,H,Y), the two rules can be joined to form a new candidate rule (A,E,G,F,H,Y) in C 5  where A, E and G are triggering events and F, H and Y form the consequential set of events. Applying the same procedure as before, the database occurrences of each i-event rule in C i   j  are counted. When matching an i-event rule with a sequence in the database, the triggering sub-sequence should first be located. If successfully located, then matching of the consequential set is conducted using the hierarchical matching approach. The candidate i-event rules with occurrences exceeding the given threshold form L i   j . 
     Referring now to FIGS. 4(a) through 4(c), a detailed process flow for data mining is given. In step 300, the number of occurrences of each event is counted across all user sequences. Those events with occurrence counts exceeding a given threshold requirement will be included in L 1 , the large 1-event set. The next step is to determine L k  for k&gt;1. In step 305, k is set to 2. In step 310, the candidate large k-event set C k , which is a super set of L k  is derived. As mentioned before, this can be done by joining L k-1  with L k-1 . Specifically, for k=2, C 2  is the cross-product of L 1  with itself. For k&gt;2, any two rules in L k-1  with the same starting event and matching k-3 of the remaining events can be joined together to form a candidate k-event rule. 
     The next step is scanning through the event sequence database to determine the number of occurrences of each candidate rule in C k . In step 315, i is set to 1, where i is the index to scan through the event sequence database. In step 320, i is compared with N, the number of event sequences in the database. If smaller than N, there are more sequences to scan. In step 335, the ith sequence in the database is denoted as S i  ={a i1 , a i2 , . . . ,a iG .sbsb.i }. The next step is to scan through the sequence using an index j. In step 340, the index j is set to 1. At step 345, j is compared with G 1  -k+1, where G 1  is the length of the i-th sequence and G 1  -k+1 is the last event in the sequence that can start a sub-sequence of length k. If j is smaller than G 1  -k+1, a ij  may start a causality rule of length k. 
     In the next steps, candidate rules in C k  are matched with a sub-sequence starting with a ij . In step 355, y is set to equal a ij . In step 360, R ij  is derived, with R ij  being the maximum potential set of consequential events that can be triggered by a ij . Next, in step 365, which becomes necessary if any of the consequential events are composite events, Φ ij  is derived by (1) replacing each composite event in R ij  by the basic events comprising it; and (2) re-ordering the basic events in lexicographic order. In step 370, D y  is denoted as the subset of C k  rules that start with a ij . 
     Next, a scan is made through D y  with an index of m to determine which candidate rules in D y  have a match with S i . In step 375, m is set to equal 1. In step 380, m is compared with the size of D y . If m is larger, such that the scanning of D y  is complete, j is incremented by 1 at step 385 and the system proceeds to step 345. If m is smaller, however, the m-th candidate rule in D y  is designated as yw 1  w 2  . . . w k-1 , at step 390. 
     In step 395, a determination is made as to whether w 1  w 2  . . . w k-1  a sub-sequence of Φ ij . If it is not a sub-sequence, the system proceeds to step 410. If it is sub-sequence, at step 400, a bipartite graph matching algorithm is applied to determine if w 1  w 2  . . . w k-1  is a sub-sequence in R ij , for the situation in which composite events are included in the set of consequential events. If the matching is not successful, the system proceeds to step 410. If it is determined that w 1  w 2  . . . w k-1  is a sub-sequence in R ij , the occurrence count of yw 1  w 2  . . . w k-1  is incremented by 1. At step 410, m is incremented by 1 and the system proceeds to step 380. 
     A comparison is made to determine if j&lt;G i  -k+1, at step 345. If the result of the comparison is &#34;no,&#34; i is incremented by 1 at step 350 and the system returns to step 320. At step 320, the value for i is compared to N. If the comparison yields a &#34;no&#34; result, C k  is checked to see if it is empty, at step 325. If not empty, L k  is derived from C k , where L k  is set to include the candidate rules in C k  with occurrence counts exceeding a pre-set threshold, at 330, and k is incremented by 1. If it is determined that C k  is empty, then all of the large event rules have been determined. 
     In step 510, from the large event sets L 2 , . . . ,L k-1 , causality rules are generated based on the confidence requirement. Finally, all redundant rules are eliminated at step 520; such that for any rule, if there exists another rule with the same triggering event and a larger consequential set containing its consequential set, (i.e., a more comprehensive rule exists) the less comprehensive rule will be eliminated. 
     The invention has been described with reference to its preferred embodiments. Many modifications within the scope of the presently disclosed invention will become apparent to one having skill in the art. As such, the scope of the invention shall not be limited by the preferred and exemplary embodiments, but only by the scope of the appended claims.