mining importance

Upload: happe-dudde

Post on 14-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 Mining Importance

    1/41

    L27/17-09-09 1Unit 4Association rule miningLecture 27/23-09-09L27/17-09-09 2

    Association Rule Mining Given a set of transactions, find rules that will predictthe occurrence of an item based on the occurrences ofother items in the transactionMarket-Basket transactionsTID Items1 Bread, Milk2 Bread, Diaper, Beer, Eggs3 Milk, Diaper, Beer, Coke4 Bread, Milk, Diaper, Beer5 Bread, Milk, Diaper, Coke

    Example of AssociationRules{Diaper} {Beer},{Milk, Bread} {Eggs,Coke},{Beer, Bread} {Milk},Implication means co-occurrence,

    not causality!L27/17-09-09 3Definition: Frequent ItemsetItemset A collection of one or more items Example: {Milk, Bread, Diaper} k-itemset An itemset that contains k itemsSupport count ( )Frequency of occurrence of an itemset

    E.g. ({Milk, Bread,Diaper}) = 2SupportFraction of transactions that contain anitemsetE.g. s({Milk, Bread, Diaper}) = 2/5TID Items1 Bread, Milk2 Bread, Diaper, Beer, Eggs3 Milk, Diaper, Beer, Coke

    4 Bread, Milk, Diaper, Beer5 Bread, Milk, Diaper, Coke

    FrequentItemsetAn itemsetwhose support isgreater than orequal to aminsup

  • 7/30/2019 Mining Importance

    2/41

    thresholdL27/17-09-09 4

    Definition: Association RuleExample:Beer } Diaper , Milk { 4 . 052| T |) Beer Diaper, , Milk (

    67 . 032) Diaper , Milk () Beer Diaper, Milk, ( cA

    ociation Rule

    An implication expression of theform X Y, where X and Y areitemsetsExample:

    {Milk, Diaper} {Beer}Rule Evaluation MetricsSupport (s)Fraction of transactions that

    contain both X and YConfidence (c)Measures how often items in Yappear in transactions thatcontain XTID Items1 Bread, Milk2 Bread, Diaper, Beer, Eggs3 Milk, Diaper, Beer, Coke4 Bread, Milk, Diaper, Beer5 Bread, Milk, Diaper, Coke

    L27/17-09-09 5Association Rule Mining TaskGiven a set of transactions T, the goal of association rulemining is to find all rules havingsupport minsup thresholdconfidence minconf threshold

  • 7/30/2019 Mining Importance

    3/41

    Brute-force approach:List all possible association rulesCompute the support and confidence for each rulePrune rules that fail the minsup and minconf thresholds Computationally prohibitive!L27/17-09-09 6

    Mining Association RulesExample of Rules:{Milk,Diaper} {Beer} (s=0.4, c=0.67){Milk,Beer} {Diaper} (s=0.4, c=1.0){Diaper,Beer} {Milk} (s=0.4, c=0.67){Beer} {Milk,Diaper} (s=0.4, c=0.67){Diaper} {Milk,Beer} (s=0.4, c=0.5){Milk} {Diaper,Beer} (s=0.4, c=0.5)TID Items1 Bread, Milk2 Bread, Diaper, Beer, Eggs3 Milk, Diaper, Beer, Coke4 Bread, Milk, Diaper, Beer5 Bread, Milk, Diaper, Coke

    Observations:All the above rules are binary partitions of the same itemset:{Milk, Diaper, Beer}Rules originating from the same itemset have identical support butcan have different confidence

    Thus, we may decouple the support and confidence requirementsL27/17-09-09 7

    Mining Association Rules Two-step approach:

    1. Frequent Itemset Generation Generate all itemsets whose support minsup2. Rule Generation Generate high confidence rules from each frequentitemset, where each rule is a binary partitioning of afrequent itemset Frequent itemset generation is stillcomputationally expensiveL27/17-09-09 8

    Frequent Itemset GenerationnullAB AC AD AE BC BD BE CD CE DEA B C D E

    ABC ABD ABE ACD ACE ADE BCD BCE BDE CDEABCD ABCE ABDE ACDE BCDEABCDEGiven d items, thereare 2dpossiblecandidate itemsetsL27/17-09-09 9

    Frequent Itemset Generation

  • 7/30/2019 Mining Importance

    4/41

    Brute-force approach: Each itemset in the lattice is a candidate frequent itemset Count the support of each candidate by scanning thedatabaseTID Items1 Bread, Milk2 Bread, Diaper, Beer, Eggs3 Milk, Diaper, Beer, Coke4 Bread, Milk, Diaper, Beer5 Bread, Milk, Diaper, Coke

    NTransactionsList ofCandidatesMwL27/17-09-09 10

    Computational Complexity Given d unique items: Total number of itemsets = 2d Total number of possible association rules:1 2 3

    111 1+ ]]]

    ,`

    .| ,`

    .|+

    d ddkk djj

  • 7/30/2019 Mining Importance

    5/41

    k dkdRIf d=6, R = 602 rulesL27/17-09-09 11

    Frequent Itemset Generation StrategiesReduce the number of candidates (M)Complete search: M=2dUse pruning techniques to reduce MReduce the number of transactions (N)Reduce size of N as the size of itemset increasesUsed by DHP and vertical-based mining algorithmsReduce the number of comparisons (NM)Use efficient data structures to store the candidates or

    transactionsNo need to match every candidate against everytransactionL27/17-09-09 12

    Reducing Number of CandidatesApriori principle:If an itemset is frequent, then all of its subsetsmust also be frequentApriori principle holds due to the following

    property of the support measure:Support of an itemset never exceeds thesupport of its subsetsThis is known as the anti-monotone property ofsupport) ( ) ( ) ( : , Y s X s Y X Y X L27/17-09-09 13

    Found to beInfrequentnullAB AC AD AE BC BD BE CD CE DE

    A B C D EABC ABD ABE ACD ACE ADE BCD BCE BDE CDEABCD ABCE ABDE ACDE BCDEABCDEIllustrating Apriori PrinciplenullAB AC AD AE BC BD BE CD CE DEA B C D EABC ABD ABE ACD ACE ADE BCD BCE BDE CDEABCD ABCE ABDE ACDE BCDE

  • 7/30/2019 Mining Importance

    6/41

    ABCDEPrunedsupersetsL27/17-09-09 14

    Illustrating Apriori PrincipleItem CountBread 4Coke 2Milk 4Beer 3Diaper 4Eggs 1Itemset Count{Bread,Milk} 3{Bread,Beer} 2{Bread,Diaper} 3{Milk,Beer} 2{Milk,Diaper} 3{Beer,Diaper} 3Itemset Count{Bread,Milk,Diaper} 3

    Items (1-itemsets)Pairs (2-itemsets)

    (No need to generatecandidates involving Cokeor Eggs)Triplets (3-itemsets)Minimum Support = 3If every subset is considered,6C1+6C2

    +6C3= 41With support-based pruning,6 + 6 + 1 = 13L27/17-09-09 15

    Apriori AlgorithmMethod:Let k=1

    Generate frequent itemsets of length 1Repeat until no new frequent itemsets areidentifiedGenerate length (k+1) candidate itemsets fromlength k frequent itemsetsPrune candidate itemsets containing subsets oflength k that are infrequent

  • 7/30/2019 Mining Importance

    7/41

    Count the support of each candidate by scanningthe DBEliminate candidates that are infrequent, leavingonly those that are frequentL27/17-09-09 16

    Reducing Number of Comparisons Candidate counting: Scan the database of transactions to determine the supportof each candidate itemset To reduce the number of comparisons, store the candidatesin a hash structure Instead of matching each transaction against every candidate, matchit against candidates contained in the hashed bucketsTID Items1 Bread, Milk2 Bread, Diaper, Beer, Eggs3 Milk, Diaper, Beer, Coke4 Bread, Milk, Diaper, Beer5 Bread, Milk, Diaper, Coke

    NTransactions Hash Structure

    kBucketsL27/17-09-09 17

    Generate Hash Tree2 3 45 6 71 4 51 3 61 2 44 5 71 2 54 5 81 5 9

    3 4 5 3 5 63 5 76 8 93 6 73 6 81,4,72,5,83,6,9Hash functionSuppose you have 15 candidate itemsets of length 3:{1 4 5}, {1 2 4}, {4 5 7}, {1 2 5}, {4 5 8}, {1 5 9}, {1 3 6}, {2 3 4}, {5 6 7},{3 4 5},{3 5 6}, {3 5 7}, {6 8 9}, {3 6 7}, {3 6 8}

    You need: Hash function Max leaf size: max number of itemsets stored in a leaf node (if number ofcandidate itemsets exceeds max leaf size, split the node)L27/17-09-09 18

    Association Rule Discovery:Hash tree1 5 91 4 5 1 3 63 4 5 3 6 7

  • 7/30/2019 Mining Importance

    8/41

    3 6 83 5 63 5 76 8 92 3 45 6 71 2 44 5 71 2 54 5 81,4,72,5,83,6,9Hash FunctionCandidate Hash TreeHash on1, 4 or 7L27/17-09-09 19

    Association Rule Discovery:Hash tree1 5 91 4 5 1 3 63 4 5 3 6 73 6 8

    3 5 63 5 76 8 92 3 45 6 71 2 44 5 71 2 54 5 81,4,72,5,83,6,9Hash Function

    Candidate Hash TreeHash on2, 5 or 8L27/17-09-09 20

    Association Rule Discovery:Hash tree1 5 91 4 5 1 3 63 4 5 3 6 73 6 83 5 63 5 76 8 9

    2 3 45 6 71 2 44 5 71 2 54 5 81,4,72,5,83,6,9Hash Function

  • 7/30/2019 Mining Importance

    9/41

    Candidate Hash TreeHash on3, 6 or 9L27/17-09-09 21

    Subset Operation1 2 3 5 6Transaction, t2 3 5 6 1 3 5 6 25 6 1 3 3 5 6 1 2 6 1 5 5 6 2 3 6 2 55 6 31 2 31 2 51 2 61 3 51 3 61 5 62 3 52 3 62 5 6 3 5 6Subsets of 3 itemsLevel 1Level 2Level 36 3 5

    Given a transaction t, whatare the possible subsets ofsize 3?L27/17-09-09 22

    Subset Operation Using HashTree1 5 91 4 5 1 3 63 4 5 3 6 73 6 83 5 63 5 76 8 9

    2 3 45 6 71 2 44 5 71 2 54 5 81 2 3 5 61 + 2 3 5 63 5 6 2 +5 6 3 +1,4,72,5,83,6,9

    Hash FunctiontransactionL27/17-09-09 23

    Subset Operation Using HashTree1 5 91 4 5 1 3 63 4 5 3 6 73 6 83 5 6

  • 7/30/2019 Mining Importance

    10/41

    3 5 76 8 92 3 45 6 71 2 44 5 71 2 54 5 81,4,72,5,83,6,9Hash Function1 2 3 5 63 5 6 1 2 +5 6 1 3 +6 1 5 +3 5 6 2 +5 6 3 +1 + 2 3 5 6transactionL27/17-09-09 24

    Subset Operation Using HashTree1 5 9

    1 4 5 1 3 63 4 5 3 6 73 6 83 5 63 5 76 8 92 3 45 6 71 2 44 5 71 2 54 5 81,4,7

    2,5,83,6,9Hash Function1 2 3 5 63 5 6 1 2 +5 6 1 3 +6 1 5 +3 5 6 2 +5 6 3 +1 + 2 3 5 6transactionMatch transaction against 11 out of 15 candidatesL27/17-09-09 25

    Factors Affecting ComplexityChoice of minimum support thresholdlowering support threshold results in more frequent itemsets this may increase number of candidates and max length offrequent itemsetsDimensionality (number of items) of the data set more space is needed to store support count of each item

  • 7/30/2019 Mining Importance

    11/41

    if number of frequent items also increases, both computation andI/O costs may also increaseSize of databasesince Apriori makes multiple passes, run time of algorithm mayincrease with number of transactionsAverage transaction width transaction width increases with denser data setsThis may increase max length of frequent itemsets andtraversals of hash tree (number of subsets in atransaction increases with its width)L27/17-09-09 26

    Compact Representation of FrequentItemsetsSome itemsets are redundant because they have identical support as their supersetsNumber of frequent itemsetsNeed a compact representation

    TID A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 C1 C2 C3 C4 C5C6 C7 C8 C9 C1011 1 1 1 1 1 1 1 1 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 021 1 1 1 1 1 1 1 1 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 031 1 1 1 1 1 1 1 1 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 041 1 1 1 1 1 1 1 1 1

    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 051 1 1 1 1 1 1 1 1 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 06 0 0 0 0 0 0 0 0 0 01 1 1 1 1 1 1 1 1 10 0 0 0 0 0 0 0 0 07 0 0 0 0 0 0 0 0 0 01 1 1 1 1 1 1 1 1 10 0 0 0 0 0 0 0 0 08 0 0 0 0 0 0 0 0 0 01 1 1 1 1 1 1 1 1 10 0 0 0 0 0 0 0 0 0

    9 0 0 0 0 0 0 0 0 0 01 1 1 1 1 1 1 1 1 10 0 0 0 0 0 0 0 0 010 0 0 0 0 0 0 0 0 0 01 1 1 1 1 1 1 1 1 10 0 0 0 0 0 0 0 0 011 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 01 1 1 1 1 1 1 1 1 112 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 01 1 1 1 1 1 1 1 1 1

  • 7/30/2019 Mining Importance

    12/41

    13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 01 1 1 1 1 1 1 1 1 114 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 01 1 1 1 1 1 1 1 1 115 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 01 1 1 1 1 1 1 1 1 1

    ,`

    .| 101103k

    kL27/17-09-09 27

    Maximal Frequent Itemsetnull

    AB AC AD AE BC BD BE CD CE DEA B C D EABC ABD ABE ACD ACE ADE BCD BCE BDE CDEABCD ABCE ABDE ACDE BCDEABCDEBorderInfrequentItemsetsMaximalItemsetsAn itemset is maximal frequent if none of its immediate supersetsis frequent

    L27/17-09-09 28Closed ItemsetAn itemset is closed if none of its immediatesupersets has the same support as the itemsetTID Items1 {A,B}2 {B,C,D}3 {A,B,C,D}4 {A,B,D}5 {A,B,C,D}Itemset Support{A} 4

    {B} 5{C} 3{D} 4{A,B} 4{A,C} 2{A,D} 3{B,C} 3{B,D} 4{C,D} 3Itemset Support

  • 7/30/2019 Mining Importance

    13/41

    {A,B,C} 2{A,B,D} 3{A,C,D} 2{B,C,D} 3{A,B,C,D} 2L27/17-09-09 29

    Maximal vs Closed ItemsetsTID Items1 ABC2 ABCD3 BCE4 ACDE5 DEnullAB AC AD AE BC BD BE CD CE DEA B C D EABC ABD ABE ACD ACE ADE BCD BCE BDE CDEABCD ABCE ABDE ACDE BCDEABCDE124 1231234 245 34512 124 244123

    23 243445122244 423 424Transaction Ids

    Not supported byany transactionsL27/17-09-09 30

    Maximal vs Closed Frequent ItemsetsnullAB AC AD AE BC BD BE CD CE DEA B C D EABC ABD ABE ACD ACE ADE BCD BCE BDE CDEABCD ABCE ABDE ACDE BCDEABCDE124 1231234 245 34512 124 24

    412323 243445122244 4

  • 7/30/2019 Mining Importance

    14/41

    23 424Minimum support = 2# Closed = 9# Maximal = 4Closed andmaximalClosed butnotmaximalL27/17-09-09 31

    Maximal vs Closed ItemsetsFrequentItemsetsClosedFrequentItemsetsMaximalFrequentItemsetsL27/17-09-09 32

    Alternative Methods for Frequent Itemset

    GenerationTraversal of Itemset LatticeGeneral-to-specific vs Specific-to-generalFrequentitemsetbordernull{a1,a2

    ,...,an}(a) General-to-specificnull{a1,a2,...,an}Frequent

    itemsetborder(b) Specific-to-general........Frequentitemsetborder

  • 7/30/2019 Mining Importance

    15/41

    null{a1,a2,...,an}(c) Bidirectional....L27/17-09-09 33

    Alternative Methods for Frequent ItemsetGenerationTraversal of Itemset LatticeEquivalent ClassesnullAB AC AD BC BDCDA BCD

    ABC ABD ACDBCDABCDnullAB ACAD BC BD CDA BCDABCABD ACD BCDABCD(a) Prefix tree (b) Suffix tree

    L27/17-09-09 34Alternative Methods for Frequent ItemsetGenerationTraversal of Itemset LatticeBreadth-first vs Depth-first(a) Breadth first (b) Depth firstL27/17-09-09 35

    Alternative Methods for Frequent ItemsetGenerationRepresentation of Database

    horizontal vs vertical data layoutTID Items1 A,B,E2 B,C,D3 C,E4 A,C,D5 A,B,C,D6 A,E7 A,B

  • 7/30/2019 Mining Importance

    16/41

    8 A,B,C9 A,C,D10 BHorizontalData LayoutA B C D E1 1 2 2 14 2 3 4 35 5 4 5 66 7 8 97 8 98 109Vertical Data LayoutL27/17-09-09 36

    FP-growth AlgorithmUse a compressed representation of thedatabase using an FP-treeOnce an FP-tree has been constructed, ituses a recursive divide-and-conquerapproach to mine the frequent itemsetsL27/17-09-09 37

    FP-tree constructionTID Items1 {A,B}2 {B,C,D}3 {A,C,D,E}4 {A,D,E}5 {A,B,C}6 {A,B,C,D}7 {B,C}8 {A,B,C}9 {A,B,D}10 {B,C,E}null

    A:1B:1nullA:1B:1B:1C:1D:1After reading TID=1:After reading TID=2:L27/17-09-09 38

    FP-Tree Constructionnull

    A:7B:5B:3C:3D:1C:1D:1C:3D:1D:1

  • 7/30/2019 Mining Importance

    17/41

    E:1E:1TID Items1 {A,B}2 {B,C,D}3 {A,C,D,E}4 {A,D,E}5 {A,B,C}6 {A,B,C,D}7 {B,C}8 {A,B,C}9 {A,B,D}10 {B,C,E}Pointers are used to assistfrequent itemset generationD:1E:1TransactionDatabaseItem PointerABCD

    EHeader tableL27/17-09-09 39

    FP-growthnullA:7B:5B:1C:1D:1C:1D:1C:3

    D:1D:1Conditional Pattern basefor D:

    P = {(A:1,B:1,C:1),(A:1,B:1),

    (A:1,C:1),(A:1),(B:1,C:1)}

    Recursively apply FP-growth on PFrequent Itemsets found(with sup > 1):

    AD, BD, CD, ACD, BCDD:1L27/17-09-09 40

    Tree ProjectionSet enumeration tree:nullAB AC AD AE BC BD BE CD CE DEA B C D EABC ABD ABE ACD ACE ADE BCD BCE BDE CDEABCD ABCE ABDE ACDE BCDE

  • 7/30/2019 Mining Importance

    18/41

    ABCDEPossible Extension:E(A) = {B,C,D,E}Possible Extension:E(ABC) = {D,E}L27/17-09-09 41

    Tree ProjectionItems are listed in lexicographic orderEach node P stores the following information:Itemset for node PList of possible lexicographic extensions of P: E(P)Pointer to projected database of its ancestor nodeBitvector containing information about whichtransactions in the projected database contain theitemsetL27/17-09-09 42

    Projected DatabaseTID Items

    1 {A,B}2 {B,C,D}3 {A,C,D,E}4 {A,D,E}5 {A,B,C}6 {A,B,C,D}7 {B,C}8 {A,B,C}9 {A,B,D}10 {B,C,E}TID Items1 {B}2 {}

    3 {C,D,E}4 {D,E}5 {B,C}6 {B,C,D}7 {}8 {B,C}9 {B,D}10 {}Original Database:Projected Databasefor node A:For each transaction T, projected transaction at node A is T E(A)L27/17-09-09 43

    ECLATFor each item, store a list of transaction ids (tids)TID Items1 A,B,E2 B,C,D3 C,E4 A,C,D5 A,B,C,D6 A,E

  • 7/30/2019 Mining Importance

    19/41

    7 A,B8 A,B,C9 A,C,D10 BHorizontalData LayoutA B C D E1 1 2 2 14 2 3 4 35 5 4 5 66 7 8 97 8 98 109Vertical Data LayoutTID-listL27/17-09-09 44

    ECLATDetermine support of any k-itemset by intersecting tid-lists of two of its (k-1) subsets.3 traversal approaches:

    top-down, bottom-up and hybridAdvantage: very fast support countingDisadvantage: intermediate tid-lists may become toolarge for memoryA145678

    9B1257810AB1578

    L27/17-09-09 45Rule GenerationGiven a frequent itemset L, find all non-emptysubsets f L such that f L f satisfies theminimum confidence requirementIf {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

  • 7/30/2019 Mining Importance

    20/41

    AB CD, AC BD, AD BC, BC AD,BD AC, CD AB,If |L| = k, then there are 2k 2 candidateassociation rules (ignoring L and L)L27/17-09-09 46

    Rule GenerationHow to efficiently generate rules from frequentitemsets?In general, confidence does not have an anti-monotone propertyc(ABC D) can be larger or smaller than c(AB D)But confidence of rules generated from the sameitemset has an anti-monotone propertye.g., L = {A,B,C,D}:c(ABC D) c(AB CD) c(A BCD)

    Confidence is anti-monotone w.r.t. number of items on theRHS of the ruleL27/17-09-09 47

    Rule Generation for AprioriAlgorithmABCD=>{ }BCD=>A ACD=>B ABD=>C ABC=>DBC=>AD BD=>AC CD=>AB AD=>BC AC=>BD AB=>CDD=>ABC C=>ABD B=>ACD A=>BCDLattice of rulesABCD=>{ }BCD=>A ACD=>B ABD=>C ABC=>DBC=>AD BD=>AC CD=>AB AD=>BC AC=>BD AB=>CD

    D=>ABC C=>ABD B=>ACD A=>BCDPrunedRulesLowConfidenceRuleL27/17-09-09 48

    Rule Generation for AprioriAlgorithm Candidate rule is generated by merging two rules thatshare the same prefixin the rule consequent join(CD=>AB,BD=>AC)

    would produce the candidaterule D => ABC Prune rule D=>ABC if itssubset AD=>BC does not havehigh confidenceBD=>AC CD=>ABD=>ABCL27/17-09-09 49

    Effect of Support Distribution

  • 7/30/2019 Mining Importance

    21/41

    Many real data sets have skewed supportdistributionSupportdistribution ofa retail data setL27/17-09-09 50

    Effect of Support DistributionHow to set the appropriate minsup threshold?If minsup is set too high, we could miss itemsetsinvolving interesting rare items (e.g., expensiveproducts)If minsup is set too low, it is computationallyexpensive and the number of itemsets is very largeUsing a single minimum support threshold maynot be effectiveL27/17-09-09 51

    Multiple Minimum SupportHow to apply multiple minimum supports?

    MS(i): minimum support for item ie.g.: MS(Milk)=5%, MS(Coke) = 3%,

    MS(Broccoli)=0.1%, MS(Salmon)=0.5%MS({Milk, Broccoli}) = min (MS(Milk), MS(Broccoli))

    = 0.1%Challenge: Support is no longer anti-monotoneSuppose: Support(Milk, Coke) = 1.5% and

    Support(Milk, Coke, Broccoli) = 0.5%

    {Milk,Coke} is infrequent but {Milk,Coke,Broccoli} is frequentL27/17-09-09 52Multiple Minimum SupportAItem MS(I) Sup(I)A 0.10% 0.25%B 0.20% 0.26%C 0.30% 0.29%D 0.50% 0.05%E 3% 4.20%BCD

    EABACADAEBCBDBECDCE

  • 7/30/2019 Mining Importance

    22/41

    DEABCABDABEACDACEADEBCDBCEBDECDEL27/17-09-09 53

    Multiple Minimum SupportABCDEABACADAEBCBD

    BECDCEDEABCABDABEACDACEADEBCDBCEBDE

    CDEItem MS(I) Sup(I)A 0.10% 0.25%B 0.20% 0.26%C 0.30% 0.29%D 0.50% 0.05%E 3% 4.20%L27/17-09-09 54

    Multiple Minimum Support (Liu1999)Order the items according to their minimumsupport (in ascending order)

    e.g.: MS(Milk)=5%, MS(Coke) = 3%,

    MS(Broccoli)=0.1%, MS(Salmon)=0.5%Ordering: Broccoli, Salmon, Coke, MilkNeed to modify Apriori such that: L1: set of frequent items

  • 7/30/2019 Mining Importance

    23/41

    F1: set of items whose support is MS(1)where MS(1) is mini( MS(i) ) C2: candidate itemsets of size 2 is generated from F1instead of L1L27/17-09-09 55

    Multiple Minimum Support (Liu 1999)Modifications to Apriori:In traditional Apriori, A candidate (k+1)-itemset is generated by merging two

    frequent itemsets of size k The candidate is pruned if it contains any infrequent subsets

    of size k

    Pruning step has to be modified:Prune only if subset contains the first iteme.g.: Candidate={Broccoli, Coke, Milk} (ordered accordingto

    minimum support){Broccoli, Coke} and {Broccoli, Milk} are frequent but{Coke, Milk} is infrequent Candidate is not pruned because {Coke,Milk} does not containthe first item, i.e., Broccoli.L27/17-09-09 56

    Pattern Evaluation Association rule algorithms tend to produce toomany rules many of them are uninteresting or redundant Redundant if {A,B,C} {D} and {A,B} {D}have same support & confidence Interestingness measures can be used toprune/rank the derived patterns In the original formulation of association rules,support & confidence are the only measures usedL27/17-09-09 57

    Application of InterestingnessMeasure

    FeatureProductP

  • 7/30/2019 Mining Importance

    24/41

    roductProductProductProd

    uctProductPro

    ductProductPr

    oductProdu

  • 7/30/2019 Mining Importance

    25/41

    ctFeatureFeatureFeatureFeatureFeatureFeatureFeatureFeatureFeatureSelectionPreprocessingMiningPostprocessing

    DataSelectedDataPreprocessedDataPatternsKnowledgeInterestingnessMeasuresL27/17-09-09 58

    Computing Interestingness MeasureGiven a rule X Y, information needed to compute rule interestingness can be

    obtained from a contingency tableY YX f11f10f1+X f01f00f

    o+f+1f+0|T|Contingency table for X Yf11: support of X and Y

  • 7/30/2019 Mining Importance

    26/41

    f10: support of X and Yf01: support of X and Yf00: support of X and YUsed to define various measuresxsupport, confidence, lift, Gini,

    J-measure, etc.L27/17-09-09 59

    Drawback of ConfidenceCoffe CoffeeTea 15 5 20Tea 75 5 8090 10 100

    Association Rule: Tea CoffeeConfidence= P(Coffee|Tea) = 0.75but P(Coffee) = 0.9Although confidence is high, rule is misleading

    P(Coffee|Tea) = 0.9375L27/17-09-09 60

    Statistical IndependencePopulation of 1000 students600 students know how to swim (S)700 students know how to bike (B)420 students know how to swim and bike (S,B)

    P(SB) = 420/1000 = 0.42P(S) P(B) = 0.6 0.7 = 0.42P(SB) = P(S) P(B) => Statistical independenceP(SB) > P(S) P(B) => Positively correlatedP(SB) < P(S) P(B) => Negatively correlatedL27/17-09-09 61

    Statistical-based MeasuresMeasures that take into account statistical

    dependence)] ( 1 )[ ( )] ( 1 )[ () ( ) ( ) , () ( ) ( ) , () ( ) () , () () | (Y P Y P X P X PY P X P Y X P

  • 7/30/2019 Mining Importance

    27/41

    t coefficienY P X P Y X P PSY P X PY X P

    InterestY PX Y P

    Lift L27/17-09-09 62

    Example: Lift/InterestCoffee CoffeeTea 15 5 20Tea 75 5 8090 10 100

    Association Rule: Tea CoffeeConfidence= P(Coffee|Tea) = 0.75but P(Coffee) = 0.9

    Lift = 0.75/0.9= 0.8333 (< 1, therefore is negativelyassociated)L27/17-09-09 63

    Drawback of Lift & InterestY YX 10 0 10X 0 90 9010 90 100Y YX 90 0 90X 0 10 1090 10 100

    10) 1 . 0 )( 1 . 0 (1 . 0 Lift11 . 1) 9 . 0 )( 9 . 0 (9 . 0 LiftStatistical independence:If P(X,Y)=P(X)P(Y) => Lift = 1L27/17-09-09 64

    Properties of A Good Measure

    Piatetsky-Shapiro:3 properties a good measure M must satisfy:M(A,B) = 0 if A and B are statistically independentM(A,B) increase monotonically with P(A,B) when P(A)and P(B) remain unchangedM(A,B) decreases monotonically with P(A) [or P(B)]when P(A,B) and P(B) [or P(A)] remain unchanged

  • 7/30/2019 Mining Importance

    28/41

    L27/17-09-09 65Comparing Different MeasuresExample f11f10f01f00E1 8123 83 424 1370E2 8330 2 622 1046E3 9481 94 127 298E4 3954 3080 5 2961E5 2886 1363 1320 4431E6 1500 2000 500 6000E7 4000 2000 1000 3000E8 4000 2000 2000 2000E9 1720 7121 5 1154E10 61 2483 4 745210 examples ofcontingency tables:Rankings of contingency tablesusing various measures:

    L27/17-09-09 66Property under VariablePermutationB

    BA p qAr s

    AAB p rB

    q s

    Does M(A,B) = M(B,A)?Symmetric measures:xsupport, lift, collective strength, cosine, Jaccard, etcAsymmetric measures:xconfidence, conviction, Laplace, J-measure, etcL27/17-09-09 67

    Property under Row/ColumnScalingMale Female

    High 2 3 5Low 1 4 53 7 10Male FemaleHigh 4 30 34Low 2 40 426 70 76Grade-Gender Example (Mosteller, 1968):Mosteller:Underlying association should be independent of

  • 7/30/2019 Mining Importance

    29/41

    the relative number of male and female studentsin the samples2x 10xL27/17-09-09 68

    Property under InversionOperation100000000100001000

    0001111111101

    111011111A B C D(a) (b)01

    1111111000

  • 7/30/2019 Mining Importance

    30/41

    00100000(c)E FTransaction 1Transaction N.....L27/17-09-09 69

    Example: -Coefficient -coefficient is analogous to correlationcoefficient for continuous variablesY YX 60 10 70

    X 10 20 3070 30 100Y YX 20 10 30X 10 60 7030 70 1005238 . 03 . 0 7 . 0 3 . 0 7 . 07 . 0 7 . 0 6 . 0

    Coefficient is the same for both tables5238 . 03 . 0 7 . 0 3 . 0 7 . 03 . 0 3 . 0 2 . 0 L27/17-09-09 70

    Property under Null AdditionB

    BA p q

    Ar s

    BBA p qAr s + k

    Invariant measures:

  • 7/30/2019 Mining Importance

    31/41

    xsupport, cosine, Jaccard, etcNon-invariant measures:xcorrelation, Gini, mutual information, odds ratio, etcL27/17-09-09 71

    Different Measures have DifferentPropertiesSymbol Measure Range P1 P2 P3 O1 O2 O3 O3' O4Correlation -1 0 1 Yes Yes Yes Yes No Yes Yes No

    Lambda 0 1 Yes No No Yes No No* Yes NoOdds ratio 0 1 Yes* Yes Yes Yes Yes Yes* Yes NoQ Yule's Q -1 0 1 Yes Yes Yes Yes Yes Yes Yes NoY Yule's Y -1 0 1 Yes Yes Yes Yes Yes Yes Yes NoCohen's -1 0 1 Yes Yes Yes Yes No No Yes NoM Mutual Inf ormation 0 1 Yes Yes Yes Yes No No* Yes NoJ J-Measure 0 1 Yes No No No No No No NoG Gini Index 0 1 Yes No No No No No* Yes No

    s Support 0 1 No Yes No Yes No No No Noc Conf idence 0 1 No Yes No Yes No No No YesL Laplace 0 1 No Yes No Yes No No No NoV Conviction 0.5 1 No Yes No Yes** No No Yes NoI Interest 0 1 Yes* Yes Yes Yes No No No NoIS IS (cosine) 0 .. 1 No Yes Yes Yes No No No YesPS Piatetsky-Shapiro's -0.25 0 0.25 Yes Yes Yes Yes No Yes Yes NoF Certainty f actor -1 0 1 Yes Yes Yes No No No Yes NoAV Added value 0.5 1 1 Yes Yes Yes No No No No No

    S Collective strength 0 1 No Yes Yes Yes No Yes* Yes NoJ cc rd 0 .. 1 No Yes Yes Yes No No No YesK Klosgen's Yes Yes Yes No No No No No3 320313 2 13

    2

    ,`

    .|

  • 7/30/2019 Mining Importance

    32/41

    ,`

    .|L27/17-09-09 72

    Support-based Pruning Most of the association rule mining algorithms usesupport measure to prune rules and itemsets Study effect of support pruning on correlation ofitemsets Generate 10000 random contingency tables Compute support and pairwise correlation for each table Apply support-based pruning and examine the tables thatare removedL27/17-09-09 73

    Effect of Support-based PruningAll Itempairs0

    1002003004005006007008009001000-1-

    0.9-0.8-0.7-0

    .6-0.5-0.4

  • 7/30/2019 Mining Importance

    33/41

    -0.3-0.2-0.100.10.20.30.

    40.50.60.70.8

    0.91CorrelationL27/17-09-09 74

    Effect of Support-based PruningSupport < 0.01050100150200

    250300-1-0.9-0

  • 7/30/2019 Mining Importance

    34/41

    .8-0.7-0.6-0.5-0.4-0.3-0

    .2-0.100.10.2

    0.30.40.50.60

    .70.80.9 1CorrelationSupport < 0.03

  • 7/30/2019 Mining Importance

    35/41

    050100150200250300-1-0.9-0.8-0.7-0.

    6-0.5-0.4-0.3

    -0.2-0.1 00.10.

    20.30.40.5

  • 7/30/2019 Mining Importance

    36/41

    0.60.70.80.9 1CorrelationSupport < 0.05050100150200250300-1-

    0.9-0.8-0.7-0

    .6-0.5-0.4-0.

    3-0.2-0.10

  • 7/30/2019 Mining Importance

    37/41

    0.10.20.30.40.50.60.70.8

    0.91CorrelationSupport-based pruningeliminates mostlynegatively correlateditemsetsL27/17-09-09 75

    Effect of Support-based PruningInvestigate how support-based pruning affects other

    measuresSteps:Generate 10000 contingency tablesRank each table according to the different measuresCompute the pair-wise correlation between the measuresL27/17-09-09 76

    Effect of Support-based PruningAll Pairs(40.14%)1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

    ConvictionOddsratioCol StrengthCorrelationInterestPSCFYuleYReliabilityKappa

  • 7/30/2019 Mining Importance

    38/41

    KlosgenYuleQConfidenceLaplaceISSupportJaccardLambdaGiniJ-measureMutual InfoxWithout Support Pruning (All Pairs)xRed cells indicate correlation between

    the pair of measures > 0.85x40.14% pairs have correlation > 0.85-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 100.10.20.30.4

    0.50.60.70.80.91CorrelationJaccar

    dScatter Plot between Correlation& Jaccard MeasureL27/17-09-09 77

    Effect of Support-based Pruningx0.5% support 50%x61.45% pairs have correlation > 0.850.005

  • 7/30/2019 Mining Importance

    39/41

    YuleYKappaISJaccardSupportLambdaGiniJ-measureMutual Info-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 100.10.20.30.40.50.60.70.80.91CorrelationJa

    ccardScatter Plot between Correlation& Jaccard Measure:L27/17-09-09 78

    0.005

  • 7/30/2019 Mining Importance

    40/41

    -0.4 -0.2 0 0.2 0.4 0.6 0.8 100.10.20.30.40.50.60.70.80.91CorrelationJaccardScatter Plot between Correlation& Jaccard MeasureL27/17-09-09 79

    Subjective Interestingness

    MeasureObjective measure: Rank patterns based on statistics computed from data e.g., 21 measures of association (support, confidence, Laplace,Gini, mutual information, Jaccard, etc).Subjective measure:Rank patterns according to users interpretation A pattern is subjectively interesting if it contradicts the

    expectation of a user (Silberschatz & Tuzhilin) A pattern is subjectively interesting if it is actionable

    (Silberschatz & Tuzhilin)L27/17-09-09 80Interestingness via UnexpectednessNeed to model expectation of users (domain knowledge)Need to combine expectation of users with evidence fromdata (i.e., extracted patterns)+Pattern expected to be frequent-Pattern expected to be infrequentPattern found to be frequent

    Pattern found to be infrequent+-Expected Patterns-+Unexpected PatternsL27/17-09-09 81

    Interestingness viaUnexpectedness

  • 7/30/2019 Mining Importance

    41/41