Frequent Pattern Mining

Slides:



Advertisements
Similar presentations
Association Rule Mining
Advertisements

Mining Association Rules in Large Databases
Recap: Mining association rules from large datasets
Association Analysis (2). Example TIDList of item ID’s T1I1, I2, I5 T2I2, I4 T3I2, I3 T4I1, I2, I4 T5I1, I3 T6I2, I3 T7I1, I3 T8I1, I2, I3, I5 T9I1, I2,
Association Rule Mining. 2 The Task Two ways of defining the task General –Input: A collection of instances –Output: rules to predict the values of any.
Data Mining Association Analysis: Basic Concepts and Algorithms
Data Mining Association Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 6 Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach,
Frequent Item Mining.
Association Analysis. Association Rule Mining: Definition Given a set of records each of which contain some number of items from a given collection; –Produce.
Data Mining Techniques So Far: Cluster analysis K-means Classification Decision Trees J48 (C4.5) Rule-based classification JRIP (RIPPER) Logistic Regression.
Data Mining Association Analysis: Basic Concepts and Algorithms Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach, Kumar Introduction.
Data Mining Association Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 6 Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach,
Data Mining Association Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 6 Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach,
Organization “Association Analysis”
Data Mining Association Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 6 Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach,
Data Mining Association Analysis: Basic Concepts and Algorithms
Association Analysis (2). Example TIDList of item ID’s T1I1, I2, I5 T2I2, I4 T3I2, I3 T4I1, I2, I4 T5I1, I3 T6I2, I3 T7I1, I3 T8I1, I2, I3, I5 T9I1, I2,
Data Mining Association Analysis: Basic Concepts and Algorithms
Data Mining Association Analysis: Basic Concepts and Algorithms
Association Analysis: Basic Concepts and Algorithms.
Data Mining Association Analysis: Basic Concepts and Algorithms
Mining Association Rules in Large Databases
© Vipin Kumar CSci 8980 Fall CSci 8980: Data Mining (Fall 2002) Vipin Kumar Army High Performance Computing Research Center Department of Computer.
Eick, Tan, Steinbach, Kumar: Association Analysis Part1 Organization “Association Analysis” 1. What is Association Analysis? 2. Association Rules 3. The.
Data Mining Association Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 6 Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach,
Data Mining Association Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 6 Introduction to Data Mining By Tan, Steinbach, Kumar Lecture.
Modul 7: Association Analysis. 2 Association Rule Mining  Given a set of transactions, find rules that will predict the occurrence of an item based on.
Data Mining Association Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 6 Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach,
Eick, Tan, Steinbach, Kumar: Association Analysis Part1 Organization “Association Analysis” 1. What is Association Analysis? 2. Association Rules 3. The.
Data Mining Association Analysis Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach, Kumar Introduction to Data Mining 4/18/
Data & Text Mining1 Introduction to Association Analysis Zhangxi Lin ISQS 3358 Texas Tech University.
Data Mining Association Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 6 Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach,
Frequent Item Mining. What is data mining? =Pattern Mining? What patterns? Why are they useful?
CSE4334/5334 DATA MINING CSE4334/5334 Data Mining, Fall 2014 Department of Computer Science and Engineering, University of Texas at Arlington Chengkai.
1 What is Association Analysis: l Association analysis uses a set of transactions to discover rules that indicate the likely occurrence of an item based.
© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/ Data Mining: Association Analysis This lecture node is modified based on Lecture Notes for.
Data Mining Association Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 6 Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach,
1 Data Mining Lecture 6: Association Analysis. 2 Association Rule Mining l Given a set of transactions, find rules that will predict the occurrence of.
Introduction to Data Mining Mining Association Rules Reference: Tan et al: Introduction to data mining. Some slides are adopted from Tan et al.
DATA MINING: ASSOCIATION ANALYSIS (2) Instructor: Dr. Chun Yu School of Statistics Jiangxi University of Finance and Economics Fall 2015.
Stats 202: Statistical Aspects of Data Mining Professor Rajan Patel
Mining Association Rules in Large Databases
Reducing Number of Candidates
Data Mining Association Analysis: Basic Concepts and Algorithms
Data Mining Association Analysis: Basic Concepts and Algorithms
Data Mining Association Analysis: Basic Concepts and Algorithms
Data Mining Association Analysis: Basic Concepts and Algorithms
Association Analysis: Basic Concepts and Algorithms
Data Mining Association Analysis: Basic Concepts and Algorithms
Data Mining Association Analysis: Basic Concepts and Algorithms
William Norris Professor and Head, Department of Computer Science
Frequent Itemsets Association Rules
COMP 5331: Knowledge Discovery and Data Mining
Association Analysis: Basic Concepts
Data Mining Association Analysis: Basic Concepts and Algorithms
Association Rule Mining
Data Mining Association Analysis: Basic Concepts and Algorithms
Data Mining Association Analysis: Basic Concepts and Algorithms
Association Analysis: Basic Concepts and Algorithms
Data Mining Association Analysis: Basic Concepts and Algorithms
Data Mining Association Analysis: Basic Concepts and Algorithms
Lecture 11 (Market Basket Analysis)
Mining Association Rules in Large Databases
Data Mining Association Analysis: Basic Concepts and Algorithms
Data Mining Association Analysis: Basic Concepts and Algorithms
Mining Association Rules in Large Databases
Data Mining Association Analysis: Basic Concepts and Algorithms
Data Mining Association Analysis: Basic Concepts and Algorithms
Association Analysis: Basic Concepts
What Is Association Mining?
Presentation transcript:

Frequent Pattern Mining Based on: Introduction to Data Mining by Tan, Steinbach, Kumar

Itemsets Some notation: All possible items: Database: T is a bag of transactions Transaction t transaction identifier: TID Items: X

Definitions Itemset Support count (σ) Support Frequent Itemset a collection of one or more items example: {Milk, Bread, Diapers} k-itemset an itemset that contains k items Support count (σ) frequency of occurrence of an itemset e.g. σ({Bread, Milk, Diapers}) = 2 Support fraction of transactions that contain an itemset e.g. s({Bread, Milk, Diapers}) = 2/5 Frequent Itemset an itemset whose support is greater than or equal to a minsup threshold

Association Rule Mining Given a set of transactions, find rules that predict the occurrence of an item based on occurrences of other items in the transaction Example of Association Rules {Diapers} → {Beer} {Milk, Bread} → {Eggs, Cola} {Beer, Bread} → {Milk} → means co-occurrence

Definitions Association Rule Rule Evaluation Measures Expression of the form X → Y (X and Y are itemsets) Example: {Milk, Diapers} → {Beer} Rule Evaluation Measures Support (s) fraction of transactions that contain both X and Y Confidence (c) measures how often items in Y appear in transactions that contain X →

Computational Complexity Given d unique items: Total number of itemsets = 2d Total number of possible association rules: If d = 6, R = 602 rules

Association Rule Mining Task Given set of transactions T, find all rules having support ≥ minsup threshold confidence ≥ minconf threshold Example of Rules: {Milk, Diapers} → {Beer} (s=0.4, c=0.67) {Milk, Beer} → {Diapers} (s=0.4, c=1.0) {Diapers, Beer} → {Milk} (s=0.4, c=0.67) {Beer} → {Milk, Diapers} (s=0.4, c=0.67) {Diapers} → {Milk, Beer} (s=0.4, c=0.5) {Milk} → {Diapers, Beer} (s=0.4, c=0.5)

Mining Association Rules Brute-force approach: List all possible association rules Compute the support and confidence for each rule Discard rules that fail the minsup and minconf thresholds ⇒ Computationally prohibitive (combinatorial explosion) Can we do better? Example of Rules: {Milk, Diapers} → {Beer} (s=0.4, c=0.67) {Milk, Beer} → {Diapers} (s=0.4, c=1.0) {Diapers, Beer} → {Milk} (s=0.4, c=0.67) {Beer} → {Milk, Diapers} (s=0.4, c=0.67) {Diapers} → {Milk, Beer} (s=0.4, c=0.5) {Milk} → {Diapers, Beer} (s=0.4, c=0.5)

Mining Association Rules Example of Rules: {Milk, Diapers} → {Beer} (s=0.4, c=0.67) {Milk, Beer} → {Diapers} (s=0.4, c=1.0) {Diapers, Beer} → {Milk} (s=0.4, c=0.67) {Beer} → {Milk, Diapers} (s=0.4, c=0.67) {Diapers} → {Milk, Beer} (s=0.4, c=0.5) {Milk} → {Diapers, Beer} (s=0.4, c=0.5) Observations: All the above rules are binary partitions of the same itemset: {Milk, Diapers, Beer} Rules originating from the same itemset have identical support but can have different confidence Thus, we may decouple the support and confidence requirements

Mining Association Rules Two-step approach: Frequent Itemset Generation (count support) Generate all itemsets whose support ≥ minsup Rule Generation (count confidence) Generate high confidence rules from each frequent itemset, where each rule is a binary partitioning of a frequent itemset

Frequent Itemset Generation Still computationally expensive: d items: 2d candidate itemsets

Frequent Itemset Generation Brute force: Match every itemset against transaction database M (2d) itemsets, N transactions: Complexity ~ O(NMw) !

Frequent Itemset Generation Strategies Need to: Reduce the number of candidates (M) Pruning Reduce the number of comparisons (NM) Efficient support counting

1) Reduce number of candidates Quiz: which itemsets can be pruned? Infrequent the Apriori principle

Apriori Algorithm Let k=1 Generate frequent itemsets of length 1 Repeat until no new frequent itemsets are identified Generate length (k+1) candidate itemsets from length k frequent itemsets Prune candidate itemsets containing subsets of length k that are infrequent Count the support of each candidate by scanning the DB Eliminate infrequent candidates, leaving only those that are frequent

(No need to generate candidates involving Coke or Eggs) Apriori Principle Minimum support = 3 Items (1-itemsets) Pairs (2-itemsets) (No need to generate candidates involving Coke or Eggs) Triplets (3-itemsets) With support-based pruning, 6 + 6 + 1 = 13 If every subset is considered, 6C1 + 6C2 + 6C3 = 41

Factors Affecting Complexity Minimum support threshold lower support threshold: more frequent itemsets increases number and length of candidate itemsets Dimensionality (number of items) more space needed to store support counts if many frequent items: computation and I/O cost increase Size of database (number of transactions) increases run time (Apriori makes multiple passes) Transaction width (density of datasets) increases number of subsets increases length of frequent itemsets and hash tree traversals

Back to Association Rules Given a frequent itemset L, find all non-empty subsets f ⊂ L such that f → L – f satisfies the minimum confidence requirement If {A,B,C,D} is a frequent itemset, candidate rules: ABC →D, ABD →C, ACD →B, BCD →A, A →BCD, B →ACD, C →ABD, D →ABC AB →CD, AC → BD, AD → BC, BC →AD, BD →AC, CD →AB, If |L| = k, then there are 2k – 2 candidate association rules (ignoring L → ∅ and ∅ → L)

Rule Generation How to efficiently generate rules? Confidence is not anti-monotone c(ABC →D) can be larger or smaller than c(AB →D) Confidence of rules generated from the same itemset is! e.g., L = {A,B,C,D}: c(ABC → D) ≥ c(AB → CD) ≥ c(A → BCD) anti-monotone w.r.t. number of items on the RHS of the rule

Quiz: which rules have low confidence? Rule Generation Quiz: which rules have low confidence? Low Confidence Rule

Quiz: which rules have low confidence? Rule Generation Quiz: which rules have low confidence? Low Confidence Rule Pruned Rules

Rule Generation for Apriori Algorithm Candidate rule generated by merging two high-confidence rules Prune D→ABC if subset AD→BC has low confidence

Condensed Representations Apriori produces very many frequent itemsets and association rules Can we represent the same information more concisely (lossless)? Condensed representations

Maximal Frequent Itemset Itemset is maximal frequent if none of its immediate supersets is frequent Quiz: which ones? Infrequent Itemsets Infrequency border

Closed Itemset An itemset is closed if none of its (immediate) supersets has the same support Quiz: which ones are closed?

Closed Itemset An itemset is closed if none of its (immediate) supersets has the same support Quiz: which ones are closed?

Quiz: which are frequent, closed, maximal? Transaction Ids Minimum support = 2 Not supported by any transactions

Quiz: which are frequent, closed, maximal? Minimum support = 2

Quiz: which are frequent, closed, maximal? Minimum support = 2

Quiz: which are frequent, closed, maximal? Minimum support = 2

End Result # Closed = 9 # Maximal = 4 Closed but not maximal Minimum support = 2 Closed and maximal # Closed = 9 # Maximal = 4

Maximal vs Closed Itemsets Maximal: determines for each itemset whether it is frequent or not fixes infrequency border Closed: determines for each itemset its support