1 / 24

Mining Sequential Patterns

Mining Sequential Patterns. Rakesh Agrawal Ramakrishnan Srikant Proc. of the Int’l Conference on Data Engineering (ICDE) March 1995 Presenter: Phil Schlosser. Topics. Introduction Problem Statement Finding Sequential Patterns (The Algorithm)

olympe
Download Presentation

Mining Sequential Patterns

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mining Sequential Patterns Rakesh Agrawal Ramakrishnan Srikant Proc. of the Int’l Conference on Data Engineering (ICDE) March 1995 Presenter: Phil Schlosser

  2. Topics • Introduction • Problem Statement • Finding Sequential Patterns (The Algorithm) • Sequence Phase (AprioriAll, AprioriSome, DynamicSome • Conclusion (Performance/FE Questions/Future work).

  3. Introduction • Bar code data allows us to store massive amounts of sales data (basket data). • We would like to extract sequential buying patterns. • E.g. Video rental: Star Wars; Empire Strikes Back; Return of the Jedi. • Can include multiple elements. • E.g. Sheet and pillow case; comforter; drapes.

  4. Problem Statement • Given a database of transactions: • Each transaction: - Customer ID - Transaction Time - Set of items purchased * No two transactions have same customer ID and transaction time * Don’t consider quantity of items purchased. Item was either purchased or not purchased

  5. Problem Statement (terms) • Itemset: non-empty set of items. Each item set mapped to an integer. • Sequence: Ordered list of itemsets. • Customer-Sequence: List of customer transactions ordered by increasing transaction time. • (A customer supports a sequence if the sequence is contained in the customer-sequence.) • Support for a sequence: Fraction of total customers that support a sequence. • Maximal Sequence: A sequence that is not contained in any other sequence. • Large Sequence: Sequence that meets minisup.

  6. Example Note: Use Minisup of 25% { (10 20) (30) } Does not have minisup (Only supported by Cust. 2) { (30) }, { (70) }, { (30) (40) } … are not maximal.

  7. The Algorithm • Sort Phase • Litemset Phase • Transformation Phase • Sequence Phase (The Biggie) • Maximal Phase

  8. Sort Phase • Sort the database: • Customer ID as the major key. • Transaction-Time as the minor key.

  9. Litemset Phase • Litemset (Large Itemset): • Supported by fraction of customers greater than minisup.

  10. Transformation Phase • Replace each transaction with all litemsets contained in the transaction. • Transactions with no litemsets are dropped. (Still considered for support counts) Note: (10 20) dropped because of lack of support. (40 60 70) replaced with set of litemsets {(40),(70),(40 70)} (60 does not have minisup)

  11. Sequence Phase • Finds Large Sequences: • AprioriAll • AprioriSome • DynamicSome • Stay Tuned….

  12. Maximal Phase • Find maximal sequences among large sequences. • k-sequence: sequence of length k • S set of all large sequences • for (k=n; k>1; k--) do foreach k-sequence sk do Delete from S all subsequences of sk Authors claim data-structures and an algorithm exist to do this efficiently. (hash trees)

  13. Sequence Phase • Sequence phase finds the large sequences. • Two families of algorithms: *****CountSome***** *****CountAll*****

  14. Final Exam Question #2 • There were two types of algorithms presented to find sequential patterns, CountSome and CountAll. What was the main difference between the two algorithms? • CountAll (AprioriAll) is careful with respect to minimum support, careless with respect to maximality.CountSome (AprioriSome) is careful with respect to maximality, careless with respect to minimum support.

  15. AprioriAll L1 = {large 1-sequences} for (k = 2; Lk-1≠ {}; k++) do begin Ck = New candidates generated from Lk-1 foreach customer-sequence c in the database do Increment the count of all candidates in Ck that are contained in c. Lk = Candidates in Ck with minimum support. end Answer = Maximal Sequences in UkLk Notation: Lk: Set of all large k-sequences Ck: Set of candidate k-sequences

  16. AprioriAll (Example) Answer: <1 2 3 4>, <1 3 5>, <4 5> Minisup = 25%

  17. AprioriSome (Forward Phase) L1 = {large 1-sequences} C1 = L1 last = 1 for (k = 2; Ck-1≠ {} and Llast≠ {}; k++) do begin if (Lk-1 known) then Ck = New candidates generated from Lk-1 else Ck = New candidates generated from Ck-1 if (k==next(last)) then begin // (next k to count?) foreach customer-sequence c in the database do Increment the count of all candidates in Ck that are contained in c. Lk = Candidates in Ck with minimum support. last = k; end end

  18. AprioriSome (Backward Phase) for (k--; k>=1; k--) do if (Lk not found in forward phase) then begin Delete all sequences in Ck contained in some Li i>k; foreach customer-sequence c in DT do Increment the count of all candidates in Ck that are contained in c Lk = Candidates in Ck with minimum support end else // lk already known Delete all sequences in Ck contained in some Li i>k; Answer = UkLk //(Maximal Phase not Needed) Notation: DT; Transformed database

  19. DynamicSome (Just the basics) • Similar to AprioriSome • AprioriSome generates Ck from Ck-1 • DynamicSome generates Ck “on the fly”

  20. Final Exam Question #1 • What was the greatest hardware concern regarding the algorithms contained in the paper? • Main memory capacity. When there is little main memory, or many potentially large sequences, the benefits of AprioriSome vanish.

  21. Final Exam Question #3 • How did the two best sequence mining algorithms (AprioriAll and AprioriSome) perform compared with each other? Take into consideration memory, speed, and usefulness of the data.

  22. Final Exam Question #3 • Memory:In terms of main memory usage, AprioriAll is better.In terms of secondary storage access, AprioriSome is better.

  23. Final Exam Question #3 • Speed:With sufficient memory, as minimum support decreases the difference between AprioriAll and AprioriSome increases. (AprioriSome is better.)More large sequences not maximal are generated.

  24. Final Exam Question #3 • Usefulness of the data:For the problem of finding maximal large sequences, the answer is “Precisely the same.”.However, AprioriAll finds all large sequences, while AprioriSome discards some large sequences that aren’t maximal. AprioriAll, then, generates more “useful” data.“The user may want to know the ratio of the number of people who bought the first k + 1 items in a sequence to the number of people who bought the first k items.”

More Related