Method for accessing data in a database

Abstract: A system and method for mining databases includes a computer-implemented program which identifies patterns of transaction sequences that are stored in a database and which recur in the database with a user-defined regularity. The invention first identifies which sequences are large, i.e., which recur with the defined regularity, and then determines which sequences are maximal, i.e., which large sequences are not subsets of other large sequences. The set of maximal large sequences is returned to the user to indicate recurring purchasing patterns over time.

Description: The present invention relates generally to data processing, and more particularly to a method for accessing data in a database to discover significant sequential patterns of transactions. Customer purchasing patterns over time can provide invaluable marketing information for a wide variety of applications. For example, advertisers can create better advertising campaigns by exploiting known consumer purchasing patterns. As a further example, retailers, with a thorough knowledge of customer purchasing patterns over time, can create more effective store displays and more effectively control inventory than would otherwise be possible without such knowledge. Still further, catalogue companies can conduct more effective mass mailings if they know that, given that a consumer has purchased a first item, the same consumer can be expected, with some degree of probability, to purchase a particular second item within a defined time period after the first purchase. It will be appreciated that purchasing patterns can be classified many ways. For example, it may be desirable to know what non-empty set of items (termed herein an "itemset"), a consumer is likely to buy together during a single transaction. Of importance to the present invention is customer transaction patterns over time. Stated differently, the focus of the present invention is to provide the means for identifying patterns in temporally-spaced customer transactions, i.e., to identify which transactions a consumer is relatively likely to undertake some time period after the consumer has undertaken other particular transactions. The present invention recognizes that by knowing such patterns, retailers and catalogue companies can, for example, create advertising and mailings which are relatively highly appealing because such advertising would be developed with the customers' previous transactions in mind. It is to be understood that although this discussion focuses on the marketing applications of the present invention, database mining and, hence, the principles of the present invention, are useful in many other areas, e.g., business and science. It happens that until recently, compiling large, detailed databases that could chronicle thousands, and from a statistical view preferably millions, of customer transactions, much less deriving useful information from the databases (i.e., mining the databases), was highly impractical. Consequently, marketing and advertising strategies have been based upon anecdotal evidence of purchasing patterns, if any at all, and thus have been susceptible to inefficiencies in consumer targeting that have been difficult if not impossible to overcome. With the advent of modern technology, however, compiling large databases of customer transactions has become possible. The ubiquitous bar-code reader can almost instantaneously read so-called basket data, i.e., when a particular item from a particular lot was purchased by a customer, how many items the customer purchased, and so on, for automatic electronic storage of the basket data. Further, when the purchase is made with, e.g., a credit card, the identity of the purchaser can be almost instantaneously known, recorded, and stored along with the basket data. Still further, vastly improved data storage media have made it possible to electronically store vast amounts of such information for future use. As alluded to above, however, compiling a transaction database is only part of the marketing challenge. Another important part is the mining of the database for useful information. Such database mining becomes increasingly problematic as the size of databases expands into the gigabyte and indeed the terabyte range. Further complicating the particular problem addressed by the present invention is that in attempting to identify customer purchasing patterns (i.e., sequences), as the skilled man will appreciate, consecutive characters of the sequences are not separated by noise characters of fixed length, but rather by noise characters of variable length. Consequently, past efforts to identify sequences in which the characters are separated by noise characters of fixed length, designed as they are to solve problems different than the one addressed herein, are ineffective to solve the particular problem faced by the present inventors. Moreover, the sequences sought to be identified by the present invention can consist of sets of characters, vice simply characters, even further complicating the problem and rendering past efforts ineffective in solving it. Accordingly, there is a need for a system and method for quickly mining large databases and in particular for ascertaining data patterns in a transaction database. It is an aim of the present invention to provide such a system and method and ideally for rapidly finding sequences of temporally-spaced transactions in a database which repeat with a user-defined degree of regularity, and which guarantees that all sequences of interest are identified. Associated with this aim is the desire to provide a system and method for quickly mining large databases which is easy to use and cost effective. This need is met by the invention as claimed in claim 1. Agrawal et al., "Fast Algorithms for Mining Association Rules", Proceedings of the 20th VLDB Conference, Santiago, Chile, 1994, pages 487-499, corresponds to the pre-characterising part of claim 1. However, it does not disclose the use of a transformed set of sequences to generate a set of large sequences as stated in the characterising part of claim 1. An embodiment of the invention will now be described, by way of example only, with reference to the accompanying drawings in which: Figure 1 is a functional block diagram of the system for mining sequential patterns of the present invention; Figure 2 is a flow chart showing the overall operation of the present invention; Figure 3 is a flow chart showing the operation of the AprioriAll embodiment of the present invention; Figure 4 is a flow chart showing the candidate generation of the AprioriAll embodiment of the present invention; Figure 5 is a flow chart showing the maximal phase of the AprioriAll embodiment of the present invention; Figure 6 is a flow chart showing the forward phase of the AprioriSome embodiment of the present invention; Figure 7 is a flow chart showing the backward phase of the AprioriSome embodiment of the present invention; Figure 8 is a flow chart showing the operation of the DynamicSome embodiment of the present invention; and Figure 9 is a flow chart showing the on-the-fly candidate generation steps of the DynamicSome embodiment of the present invention. Referring initially to Figure 1, a system for mining databases for transaction sequences is shown, generally designated 10. In the particular architecture shown, the system 10 includes one or more digital processing apparatus, such as a client computer 12 and a server computer 14. In one intended embodiment, the server computer 14 may be a mainframe computer made by IBM Corp. of Armonk, N.Y., and use an operating system sold under trademarks such as MVS. Or, the server computer 14 may be a Unix computer, or OS/2 server, or Windows NT server. The server computer 14 may own a database system, such as DB2 or ORACLE, or it may have data on files on some data storage medium such as disk or tape. As shown, the server computer 14 includes a mining kernel 16 which may be executed by a processor within the server computer 14 as a series of computer-executable instructions. These instructions may reside, for example, in RAM of the computer 14. It is to be understood that architectures other than the one shown may be used. For example, the functions of the client computer 12 may be incorporated into the server computer 14, and vice versa. Alternatively, the instructions may be contained on a data storage medium, such as a computer diskette. Or, the instructions may be stored on a DASD array, magnetic tape, conventional hard disk drive, electronic read-only memory, optical storage device, paper punch cards, or other appropriate data storage device. In an illustrative embodiment of the invention, the computer-executable instructions may be lines of compiled C++ language code. Figures 2-9 illustrate, in the form of a flowchart, the structure of such a computer program. Figure 1 shows that, through appropriate data access programs and utilities 18, the mining kernel 16 accesses one or more databases 20 and/or flat files (i.e., text files) 22 which contain data chronicling transactions. After executing the steps described below, the mining kernel outputs the desired transaction data to a mining results repository 24, which can be accessed by the client computer 12. Additionally, Figure 1 shows that the client computer 12 can include a mining kernel interface 26 which, like the mining kernel 16, may be implemented in suitable computer code. Among other things, the interface 26 functions as an input mechanism for establishing certain variables, including the minimum support value defined below. Further, the client computer 12 preferably includes an output module 28 for outputting/displaying the mining results on a graphic display 30, print mechanism 32, or data storage medium 34. Figure 2 shows the overall method of the present invention. Beginning with block 36, the system 10 sorts the data in the database 20, preferably into a hash tree configuration. In understanding how the system 10 sorts the database 20, and indeed in understanding the problem on which the present invention is focused, reference to Tables 1-3 is helpful. Original Database Transaction Time Customer ID. Items Purchased June 10 2 10, 20 June 12 5 90 June 15 2 30 June 20 2 40, 60, 70 June 25 4 30 June 25 3 30, 50, 70 June 25 1 30 June 30 1 90 June 30 4 40, 70 July 25 4 90 July 26 3 50 Database sorted by Customer ID Customer ID . Transaction Time Items Purchased 1 June 25 30 1 June 30 90 2 June 10 10, 20 2 June 15 30 2 June 20 40, 60, 70 3 June 25 30, 50, 70 3 July 26 50 4 June 25 30 4 June 30 40, 70 4 July 25 90 5 June 12 90 Customer Sequence Version of Database Customer ID. Customer Sequence 1 <(30) (90)> 2 <(10 20) (30) (40 60 70)> 3 <(30 50 70) (50)> 4 <(30) (40 70) (90)> 5 <(90)> Customer Sequences Transformed to Large Itemsets Sequential Patterns with Support > 25% <(30) (90)> <(30) (40 70)> As shown in Table 1, the database 20 typically is initially arranged by transaction time, and it contains data on both customer identity and itemsets that were purchased as part of the transaction. As intended by the present invention, an itemset includes one or more items. Accordingly, for the first transaction shown in Table 1, the transaction is characterized by the itemset <(10, 20)>, wherein items 10 and 20 are individual items. Stated differently, a transaction may contain one or more items, i.e., a transaction may (and usually will) be composed of itemsets. Further, for a given customer the period between transactions may vary. The problem addressed by the present invention is mining the database 20 to identify sequences of time-spaced transactions which are large, and which preferably are also maximal sequences. By large sequences is meant the sequences which appear in the database with a user-defined regularity, termed herein as "minimum support". For example, the user may want to know what transaction sequences appear for at least 25% of the customers in the database. The minimum support value in this instance is 25%, and by counting the number of customers who support a sequence and then dividing by the total number of customers, it may be determined whether the sequence meets the minimum support criterion. Likewise, by counting the number of customers who support an itemset and then dividing by the total number of customers, it may be determined whether the itemset meets the minimum support criterion. On the other hand, a large sequence may or may not be maximal. For some applications, it may desirable to know all large sequences. For other applications, it may be desirable to know only the large sequences that are also maximal. A sequence is maximal if it is not contained in any other (longer) sequence. A sequence of items (a 1 , a 2 .... a n ) is contained in another sequence (b 1 , b 2 ...b m ) if there exists integers i 1 <i 2 <i n <, such that a 1 ⊆ b i1 ,...a n ⊆ b in . Accordingly, the sequence <(3) (4 5) (8)> is contained in the sequence <(7) (3 8) (9) (4 5 6) (8)>, but the sequence <(3) (5)> is not contained in <(3 5)>, and vice-versa. At block 36, the data is sorted by customer identity, and for a given customer by transaction time, as shown in Table 2. Then, the data is rearranged as shown in Table 3, such that for each customer, the transactions are arranged in temporal sequence. For instance, in Table 3, for customer #2, three transactions are included in the customer sequence. The first transaction for customer #2 includes items #10 and #20, the second transaction includes item #30, and the third transaction includes items #40, 60, and 70. If desired, the transactions in the database 20 can be further screened for certain time criteria. For example, it may not be desirable to count two transactions as being in a single sequence if some minimal time period is not present between them, or if some maximal time period has been exceeded between transactions. Next, at block 38, the system 10 identifies the large itemsets in the sorted database. As intended by the present invention, an itemset is supported only once by a given customer. Thus, for customer #3 in Table 3, although item #50 appears twice it is counted only once in determining whether it meets the minimum support criterion. The general method of determining whether an itemset is large is discussed above. It should be noted that in counting itemset/transaction sequences, customer #4 supports the sequence <(30) (90)> because the sequences of interest do not necessarily include contiguous items. Further, the sequence <(30) (40 70)> is supported by both customers #2 and #4, in that customer #2, in a single transaction, buys item #60 along with items #40 and #70, and <(40 70)> is a subset of <(40 60 70)>. The following publications, all of which are incorporated herein by reference, disclose specific methods for finding large itemsets: Agrawal et al., "Mining Association Rules Between Sets of Items in Large Databases", Proc. of the ACM Sigmod Conference on Management of Data, Washington, D.C. 1993; Agrawal et al., "Fast Algorithms for Mining Association Rules in Large Databases", Proc. of the VLDB Conference, Santiago, Chile 1994; Houtsma et al., "Set-Oriented Mining of Association Rules", IBM Research Report RJ 9567, October, 1993; and Mannila et al., "Efficient Algorithms for Discovering Association Rules", KDD-94:AAAI Workshop on Knowledge Discovery in Databases, July 1994. The methods set forth in the above-referenced publications should be modified to count a customer only once for support of an itemset, even if the customer buys the same itemset in two different transactions. Then, at block 40, the customer sequences are transformed to sequences of large itemsets, as shown in Table 4. More particularly, in the example shown in Tables 1-4, only sequences <(30 90)> and <(30) (40 70)> are Maximal and large, i.e., appear for at least 25% of the customer fields. Table 4 shows an example of a transformed database of the present invention, designated D T . As the skilled artisan will recognize, D T is essentially a transformed set of customer sequences. At block 42, the desired large sequences are found by one of the concatenation regimes described below, and at block 44, the set of maximal large sequences are found. Without loss of generality of the present invention, as further disclosed below the operations undertaken in blocks 42 and 44 may be combined in some concatenation regimes. Accordingly, as intended by the present invention block 42 establishes a large sequence determiner which compares the number of times a sequence is repeated in the database and which designates the sequence as a large sequence when the number of times is greater than the minimum support value. Furthermore, block 44 establishes a maximal large sequence generator which designates as a maximal large sequence any large sequence which is not contained in another large sequence. Now referring to Figures 3-5, the first of three embodiments, termed herein "AprioriAll", of the concatenation regime of the present invention used at block 42 and 44 of Figure 2 is shown. As disclosed below in reference to Figure 3, the method starts at block 46 for each k. In general, in the AprioriAll method, a seed set of large sequences L k-1 having a length (i.e., number of itemsets) equal to "k-1" (initially consisting of the set of large itemsets disclosed above, wherein k=2) is used for generating a set of candidate large sequences c k having length k+1 at block 48. Then, the method determines the support for the candidate large sequences by examining the transformed customer sequences c T in D T to increment the count of each candidate sequence in C k that is contained in some c T and then dividing by the total number of customers. At block 52, the resulting forward set L k of actual large sequences become the seed for the next iteration. After determining all of the large sequences (by ascertaining, at decision block 54, whether L k is null), the maximal sequences among the large sequences can be determined as disclosed in reference to Figure 5 below. If L k is not null at block 54, the method proceeds to block 56 to set k = k + 1, and thence to block 46. Figure 4 shows the details of creating sets of candidate large sequences. At block 58, L k-1 is concatenated (i.e., joined) to itself to create an initial C k having c sequences. More particularly, the itemsets, designated as p.litemset 1 , p.litemset 2 ...p.litemset k-1 of L k-1 are joined to each of the other itemsets, designated q.litemset 1 , q.litemset 2 ...q.litemset k-1 in L k-1 to yield a set C k of candidate large sequences c, each c having k itemsets, with the constraint that no sequence c in C k is repeated. Thus, using Table 5 below as an example: Sequence Support After Join <1 2 3> 2 <1 2 3 4> <1 2 4> 2 <1 2 4 3> <1 3 4> 3 <1 3 4 5> <1 3 5> 2 <1 3 5 4> <2 3 4> 2 <1 2 3 3> <1 2 4 4> <1 3 4 4> <1 3 5 5> <2 3 4 4> Next, the system 10 prunes candidate sequences c from C k which contain any subsequences not found in L k-1 . The system 10 considers, at block 60, each customer sequence c in the set of candidate large sequences C k as described below, and then proceeds to block 62 for each subsequence s having k-1 itemsets of the candidate set of large sequences c k . Starting with the initial candidate sequence c in the set of candidate large sequences C k , and with the initial subsequence s of C k having k-1 itemsets at decision block 64, the system 10 determines whether s is an element of the immediately preceding set of actual large sequences L k-1 . As intended by the present invention, the set of large itemsets is used as the seed for the first iteration. If s is an element of the immediately preceding set of actual large sequences L k-1 , the system 10 moves back to block 62 to retrieve the next subsequence s in C k . Otherwise, the system 10 proceeds to block 66 to delete, i.e., prune, c from C k , and then the system 10 returns to block 60 to test the next sequence c in C k . In the example shown in Table 5, only the sequence <1 2 3 4> is left after pruning. Figure 5 shows the method by which the AprioriAll method can, if desired, determine which of the large sequences found above are maximal large sequences. Starting at block 78, a set S is defined to be the sum of all the sets L k of large sequences, k = n to 1, wherein n is the largest sequence length found above. Then, at block 80, the system 10 selects an s n sequences in L n and determines, at decision block 82, whether any subsequences of s n are in S. If so, the system 10 proceeds to block 84 to delete those subsequences, and thence to decision block 86 to determine whether the sequence s under test is the last sequence in L n . Otherwise, the system 10 proceeds directly to decision block 86. If, at decision block 86, the sequence under test is not the last sequence in L n , the system proceeds to block 88 to select the next sequence in L n . and then returns to decision block 82. On the other hand, if the test at decision block 86 is positive, the system 90 proceeds to block 90 to set n=n-1, and then tests at decision block 92 whether n=1. If not, the system 10 returns to block 80. Otherwise, the system 10 proceeds to output block 93 and outputs S as the set of maximal large sequences. Figures 6-9 show alternate methods of the present invention, termed herein AprioriSome (Figures 6 and 7) and DynamicSome (Figures 8 and 9). In both of these so-called count-some methods, some sequences are counted in a forward phase, wherein successively longer candidate sequences are generated and counted, with some of the remaining sequences counted in a backward phase, wherein successively shorter sequences are counted, but generally after being sorted for maximization. Thereby, under some circumstances the count-some methods will count fewer large, non-maximal sequences than will the AprioriAll method. Referring to Figures 6 and 7, the AprioriSome method begins at block 94. Like the AprioriAll method disclosed above, the AprioriSome method generates successive sets of successively longer candidate sequences Ck in a forward phase, so called because in this phase each successive iteration uses a value for k which has been increased vis-a-vis the immediately preceding value for k. In contrast to the AprioriAll method, however, the AprioriSome method does not count each set C k of candidate sequences to generate a forward set L k of actual large sequences from the candidates while incrementing k upwardly. Rather, under AprioriSome the counting of some sets C k is skipped in the forward phase (Figure 6), establishing skipped sets of candidate large sequences. Then, after the forward phase, the skipped sets of candidate large sequences are first pruned of non-maximal sequences in a backward phase (Figure 7), so called because in each iteration of the phase the value for k is decreased vis-a-vis the immediately preceding k. After pruning, the candidate large sequences are then counted by examining the database D T of transformed customer sequences, to determine which are large. Accordingly, the skilled artisan will recognize that under AprioriSome, the counting of some non-maximal large sequences is avoided. At block 94 of Figure 6, a set C k of candidate large sequences is generated as described above, using a concatenation of L k-1 or, if L k-1 has not been determined, the previously determined C k-1 (wherein k=2 for the initial iteration). Moving to decision block 95, the system 10 determines whether the present set C k of candidate large sequences is empty. If so, the system 10 moves to Figure 7. Otherwise, the method proceeds to decision block 96. At decision block 96, the system 10 determines whether the current k equals the step value k'. If not, the method proceeds to block 97, wherein k is incremented by one (1). If, at decision block 96, the system 10 determines that k=k', the process proceeds to block 98 to count C k to determine which candidate large sequences actually are large by examining the database D T of transformed customer sequences, in accordance with the principles discussed above. From block 98, the method moves to block 99. At block 99, a set L k of actual large sequences is defined to be the candidates in the set C k of candidate large sequences having minimum support, as determined at block 98. Proceeding to decision block 100, the system 10 next determines whether the set L k of candidate large sequences is empty. If it is, the method proceeds to the steps of Figure 7. Otherwise, the method proceeds to block 101. At block 101, a step value k' for the next set of candidate large sequences to be counted is determined. Under the AprioriSome method, the step value k' does not necessarily equal the previous k plus one (1). but may equal the previous k plus some integer greater than one (1). In determining the value of k', the following heuristic is used: For the current iteration, find the ratio α of the absolute value of L k to C k , i.e., determine |L k |/|C k |. If α < .666, k' = k+1; if .666 < α < .75, k' = k+2; if .75 < α < .80, k' = k+3; if .80 < α < .85, k' = k+4; if .85 < α, k' = k+5. From block 101, the method returns to block 97. To simplify disclosure, but without loss of generality, the forward and backward phases of Figures 6 and 7, respectively, are discussed separately herein. It is to be understood, however, that it may be preferable to intersperse them to reduce the memory size requirements of system 10. Thus, instead of proceeding to the backward phase of Figure 7 only after C k or L n has been found to be empty in the forward phase, the system 10 may alternately conduct forward phase steps and backward phase steps. In other words, the system 10 may proceed to Figure 7 after each set L k of actual large sequences is determined in the forward phase, then return to Figure 6 to calculate the next series of skipped sets of candidate large sequences between successive counted sets, as well as the next counted set of candidate large sequences, and so on. Now referring to Figure 7, the backward phase of the AprioriSome method is shown. Starting with the set L k of counted large sequences having the highest k value and then iterating downwardly, the system 10 begins at decision block 102. At decision block 102, the system 10 determines whether, for the present value of k, the set L k of actual large sequences was generated (by counting the associated set C k of candidate large sequences) during the forward phase. If not, the system 10 proceeds to block 104 to delete all sequences c in the set C k of candidate large sequences that are contained in a sequence of a set L i of actual large sequences which is larger than the set C k of candidate large sequences, wherein i > k. Next, at block 106, the system 10 counts the sequences c in the set C k of candidate large sequences by examining the transformed customer sequence database D T to determine which candidate sequences are actually large, in accordance with the principles disclosed above. Then, in accordance with the principles disclosed above, at block 108 the system 10 defines a set L k of actual large sequences to be equal to the set of candidate sequences in the set C k of candidate large sequences which have minimum support. From block 108, the system 10 proceeds to block 110, wherein k is incremented downwardly by one (1). Then, at decision block 112, the system 10 determines whether k = 2, and if so, outputs the summation of the sets L k at output block 114 as the set of maximal large sequences in the database 20. On the other hand, if, at decision block 112, the system 10 determines that k does not equal 2, then the system 10 proceeds to block 116 to test the next k by looping back to decision block 102. If, at decision block 102, the system 10 determines that L k was known, then the system 10 proceeds to block 118 to maximize the large sequences in L k by deleting from L k all sequences that are contained in a larger set L i of actual large sequences, wherein i > k. From block 118, the system 10 proceeds to block 110 and operates as discussed previously. Figures 8 and 9 show the DynamicSome concatenation regime of the present invention. Unlike the AprioriSome method, the DynamicSome not only skips counting certain sets C k of candidate large sequences in a forward phase, but does not even generate them until an intermediate phase. Then, DynamicSome uses a backward phase identical to that disclosed above for AprioriSome. Also, the generation procedure used in the forward phase of DynamicSome is unique to DynamicSome. As mentioned above, while the phases are treated separately for disclosure purposes, they may be interspersed in actual implementation. At block 120 in Figure 8, an initialization phase is commenced in which the system 10 receives an input representing a step integer. Sets L k , k< step integer, of actual large integers are determined as disclosed above, starting with the set of large itemsets L 1 as a seed set. Thus, for a user-defined step integer of 3, L 1 , L 2 , and L 3 are generated. Next, a forward phase is commenced at block 124, wherein each C k+step is determined from L step , L k as described in greater detail in reference to Figure 9 below. At block 126, the transformed customer sequence database D T is examined to generate L k+step from C k+step in accordance with principles disclosed previously. Then, an intermediate phase is commenced at block 128, wherein skipped sets C k of candidate large sequences are generated. If L k-1 is known, the skipped set C k of candidate large sequences is generated by concatenating L k-1 in accordance with the principles enunciated above. Otherwise, the skipped set C k of candidate large sequences is generated by concatenating C k-1 in accordance with the principles enunciated above. After generating the skipped set or sets C k of candidate large sequences (depending on whether the phases of DynamicSome are interspersed with each other), at circle 130 the system 10 moves to the backward phase shown in Figure 7 to generate and output the set of maximal large sequences. Figure 9 shows the details of the forward phase of the DynamicSome method. Starting at block 132, a set X k is defined to be the set of subsequences in L k , c, wherein c = sequences in the transformed customer sequence database D T . Then, at block 134 the system 10 performs, for all elements x in X k , the operation shown in block 136. At block 136, a variable x end is defined to be the minimum value of j in the sequence (c 1 , c 2 , ... c j ), where j = the step integer defined at block 120 of Figure 8. Next, at block 138, a set X j is defined to be the set of subsequences in L j , c, wherein c = sequences in the transformed customer sequence database D T . Then, at block 140, the system 10 performs, for all elements x in X j , the operation scheme shown in block 142. At block 142, a variable x start is defined to be the maximum value of j in the sequence (c j , c j+1 ,...cn). At block 144, X k is concatenated with X j such that X k.end < X j.start , to thereby generate C k+step . Thus has been described a program storage device readable by a digital processing apparatus and tangibly embodying a program of instructions executable by the digital processing apparatus to perform method steps for identifying sequential patterns in transaction sequences which are stored in a database, each sequence comprising a plurality of temporally-spaced transactions characterized by one or more itemsets, the method steps comprising: (a) entering an itemset into a set of large itemsets when the number of times the itemset is present in the database exceeds a minimum support value; (b) discarding a transaction when the transaction does not include an itemset in the set of large itemsets and discarding a sequence when the sequence does not include an itemset in the set of large itemsets, to generate a transformed set of sequences; (c) defining a forward set of large sequences and concatenating sequences in the forward set of large sequences in accordance with a predetermined concatenation regime to generate a next set of candidate large sequences; (d) comparing each sequence in the next set of candidate large sequences to the sequences in the transformed set of sequences to determine the number of times the candidate large sequence is present in the transformed set of sequences; (e) entering a candidate large sequence into a next forward set of large sequences when the number of times the candidate large sequence is present in the transformed set of sequences is greater than the minimum support value; and (f) outputting the set of maximal large sequences for identifying particular transaction sequences over time. In a preferred device, the program instructions implement the method step of entering a large sequence into a set of maximal large sequences when the sequence is not contained in another large sequence; wherein the method iteratively repeats selected steps, and step (c) includes defining the forward set of large sequences in an iteration to be the next forward set of large sequences of the immediately preceding iteration. In a further preferred device, the program-implemented method iteratively repeats selected steps such that for each iteration the predetermined concatenation regime causes the device to concatenate the sequences in the immediately preceding forward set of large sequences to generate the next set of candidate large sequences, each candidate large sequence having one more itemsets than the large sequences used to generate it, and to successively enter candidate large sequences into the subsequent next forward set of large sequences. Preferably selected next sets of candidate large sequences are generated by concatenating the candidate large sequences of a preceding step to generate sets of skipped candidate large sequences. In a preferred implementation the method further comprises the steps of: after at least one iteration is complete, comparing skipped candidate large sequences to selected sequences generated in previous iterations; discarding skipped candidate large sequences when they are contained in sequences generated in previous iterations to generate a set of remaining skipped sequences; comparing each remaining skipped sequence to the sequences in the transformed set of sequences to determine the number of times the remaining skipped sequence is present in the transformed set of sequences; and entering a remaining skipped sequence into the set of maximal large sequences when the number of times the remaining skipped sequence is present in the transformed set of sequences is greater than the minimum support value. A further preferred program storage device embodies the program instructions whereby the method iteratively repeats selected steps such that for each iteration the predetermined concatenation regime causes the device to concatenate at least some of the large sequences to generate a set of candidate large sequences, each candidate large sequence containing n itemsets more than at least some of the large sequences used to generate it, wherein n is an integer greater than one (1). It is further preferred that the spacing between iterations is n, and sets of candidate large sequences are generated between iterations only after at least one iteration has been completed by concatenating selected sequences to generate sets of skipped candidate large sequences. The program instructions preferably embody the further method steps of: after at least one iteration is complete, generating skipped candidate large sequences and comparing them to sequences generated in previous iterations; discarding skipped candidate large sequences when they are contained in sequences generated in previous iterations to generate a set of remaining skipped sequences; comparing each remaining skipped sequence to the sequences in the transformed set of sequences to determine the number of times the remaining skipped sequence is present in the transformed set of sequences; and entering a remaining skipped sequence into the set of maximal large sequences when the number of times the remaining skipped sequence is present in the transformed set of sequences is greater than the minimum support value. while the particular system and method for mining sequential patterns as herein shown and described in detail is fully capable of attaining the above-described objects of the invention, it is to be understood that it is the presently preferred embodiment of the present invention and is thus representative of the subject matter which is broadly contemplated by the present invention, that the scope of the present invention fully encompasses other embodiments which may become obvious to those skilled in the art, and that the scope of the present invention is accordingly to be limited by nothing other than the appended claims.

Claims: A computer-implemented method for identifying patterns in transaction sequences, each sequence comprising a series of temporally-spaced transactions which are stored in a database, each transaction including one or more itemsets, the method comprising: entering (38) an itemset into a set of large itemsets when the number of times the itemset is present in the database exceeds a predefined value; characterised by : generating (40) a transformed set of sequences by discarding a transaction when the transaction does not include an itemset in the set of large itemsets and discarding a sequence when the sequence does not include an itemset in the set of large itemsets; and generating (42) a set of large sequences which appear in the database a number of times exceeding the predefined value, including the steps of: (i) defining a seed set of candidate large sequences; (ii) concatenating sequences in the seed set to generate a next set of candidate large sequences; (iii) comparing each sequence in the next set of candidate large sequences to the sequences in the transformed set of sequences to determine the number of times the candidate large sequence is present in the transformed set of sequences; (iv) entering a candidate large sequence into a next forward set of candidate large sequences when the number of times the candidate large sequence is present in the transformed set of sequences is greater than the predefined value and employing the next forward set of candidate large sequences as the seed set in step (i); and (v) repeating steps (ii) to (iv) until no further sequences are entered in the next forward set of candidate large sequences. A method as claimed in claim 1, further comprising the steps of: entering a large sequence into a set of maximal large sequences when the sequence is not contained in another large sequence; and defining the forward set of large sequences in an iteration to be the next forward set of large sequences of the immediately preceding iteration. A method as claimed in claim 2, further comprising the step of concatenating the sequences in the immediately preceding forward set of large sequences to generate the next set of candidate large sequences, each candidate large sequence having one more itemset than the large sequences used to generate it, and to successively enter candidate large sequences into the subsequent next forward set of large sequences. A method as claimed in claim 3, wherein the spacing between iterations is one. A method as claimed in claim 3, wherein selected next sets of candidate large sequences are generated by concatenating the candidate large sequences of a preceding step to generate sets of skipped candidate large sequences. A method as claimed in claim 5, wherein the method further comprises the steps of: after at least one iteration is complete, comparing skipped candidate large sequences to selected sequences generated in previous iterations; discarding skipped candidate large sequences when they are contained in sequences generated in previous iterations to generate a set of remaining skipped sequences; comparing each remaining skipped sequence to the sequences in the transformed set of sequences to determine the number of times the remaining skipped sequence is present in the transformed set of sequences; and entering a remaining skipped sequence into the set of maximal large sequences when the number of times the remaining skipped sequence is present in the transformed set of sequences is greater than the predefined value. A method as claimed in claim 2, wherein selected steps are iteratively repeated such that for each iteration the predetermined concatenation regime concatenates at least some of the large sequences to generate a set of candidate large sequences, each candidate large sequence containing n itemsets more than at least some of the large sequences used to generate it, wherein n is an integer greater than one (1). A method as claimed in claim 7, wherein the spacing between iterations is n, and sets of candidate large sequences are generated between iterations only after at least one iteration has been completed by concatenating selected sequences to generate sets of skipped candidate large sequences. A method as claimed in claim 8, further comprising the steps of: after at least one iteration is complete, generating skipped candidate large sequences and comparing them to sequences generated in previous iterations; discarding skipped candidate large sequences when they are contained in sequences generated in previous iterations to generate a set of remaining skipped sequences; comparing each remaining skipped sequence to the sequences in the transformed set of sequences to determine the number of times the remaining skipped sequence is present in the transformed set of sequences; and entering a remaining skipped sequence into the set of maximal large sequences when the number of times the remaining skipped sequence is present in the transformed set of sequences is greater than the minimum support value. A program storage device comprising a computer usable medium having computer readable program code embodied thereon for executing the method of any preceding claim.

Inventors: AGRAWAL RAKESH, SRIKANT RAMAKRISHNAN, AGRAWAL, RAKESH, SRIKANT, RAMAKRISHNAN
Applicants: IBM, INTERNATIONAL BUSINESS MACHINES CORPORATION
Application year: 1996
Main classification: G06F9
IPC codes: G06F17, G06Q30, G06F12, G06F19