Apriori Algorithm   Hash Based and Graph Based Modifications
Agenda Data Mining Association Rule  Ariori Algorithm Hash Based Method  Graph Based Approach Conclusion and Future Work
Data Mining Data mining is the process of extracting patterns (knowledge) from  data .  The aim of data mining is to automate the process of finding interesting patterns and trends from a given data.  It is seen as an increasingly important tool by modern business to transform data into business intelligence giving an informational advantage. It is currently used in a wide range of  profiling practices , scientific discovery, and decision making.
Association Rules Association rule learning is a popular and well researched method for discovering interesting relations between variables in large database.  For example, the rule found in the sales data of a supermarket would indicate that if a customer buys onions and potatoes together, he or she is likely to also buy burger. Such information can be used as the basis for decisions about marketing activities.
Problem Description I = {A, B, C} Possible Item sets:
Support and Confidence Support (A -> B) =  No. of transactions containing A & B ________________________________ No. of total transactions Confidence (A -> B) = No. of transactions containing A & B _________________________________ No. of transactions containing A
Original Apriori Algorithm
L1 = {large 1-itemsetsg} for  ( k = 2; Lk !=0,  k++ ) do begin Ck = apriori-gen(Lk-1 );  // New candidates for  all transactions t Є D do begin Ct = subset (Ck , t);  // Candidates contained in t for  all candidates c Є Ct do c.count++; end Lk = {c  Є  Ck | c.count >=  minsup} end
 
Hash based method   Repeat   //for each transaction of the database { D = { set of all possible k-itemsets in the ith transaction} For  each element of D { Find a unique integer uniq_int using thehash function for k-itemset Increment   freq[uniq_int] } Increment  trans_pos //Moves pointer to next transaction until end_of_file For  (freq_ind=0; freq_ind<length_of_the_array(two_three_freq[]); freq_ind++) { if (freq[freq_ind] >= required support) mark the corresponding k-itemset } }
Graph based approach   Procedure FrequentItemGraph (Tree, F) { scan  the DB once to collect the frequent 2-itemsets and their support ascending; add  all items in the DB as the header nodes for  each 2-itemset entry (top down order) in freq2list do if   (first item = item in header node)  then create a link to the corresponding header node i=3 for  each i-itemsets entry in the tree  do call buildsubtree (F) end  } Procedure  buildsubtree (F) If  (first i-1 itemset = itemsets in their respective header nodes)  then create  a link to the corresponding header node i=i+1 repeat  buildsubtree (F) end  }
Example: a c g T4 b c e f g T3 a b c e f g T2 b e T1 Items Transaction
Conclusion and Future Work In order to be able to continue with the hashing method, we need a perfect hash function h(e1, e2,…, ek), this hash function can be obtained by one of the following methods: h(e1,e2,…,ek) = prm(1)^e1 + prm(2)^e2 + … + prm(k)^ek Where prm is the set of prime numbers, prm = {2, 3, 5, 7…} Although this hash function guarantee a unique key for every itemset, but it requires an irrational memory space, for example, consider an original item set X with only 10 items, and the following T hashed item set, T = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, consider a 4-itemset (1, 2, 3, 10), this item set will be hashed to the value “282475385”, this will result in reserving large memory space without being used effectively. Other perfect hash functions, used in hashing strings, are not applicable here, because the input variables are limited to 26, which is the number of alphabets, while the number of items in a certain database can be very larger than this.
Use hashing techniques to find the efficient frequent 2-itemsets in order to reduce the time and memory requirements to build a graphical structure

Apriori algorithm

  • 1.
    Apriori Algorithm Hash Based and Graph Based Modifications
  • 2.
    Agenda Data MiningAssociation Rule Ariori Algorithm Hash Based Method Graph Based Approach Conclusion and Future Work
  • 3.
    Data Mining Datamining is the process of extracting patterns (knowledge) from data . The aim of data mining is to automate the process of finding interesting patterns and trends from a given data. It is seen as an increasingly important tool by modern business to transform data into business intelligence giving an informational advantage. It is currently used in a wide range of profiling practices , scientific discovery, and decision making.
  • 4.
    Association Rules Associationrule learning is a popular and well researched method for discovering interesting relations between variables in large database. For example, the rule found in the sales data of a supermarket would indicate that if a customer buys onions and potatoes together, he or she is likely to also buy burger. Such information can be used as the basis for decisions about marketing activities.
  • 5.
    Problem Description I= {A, B, C} Possible Item sets:
  • 6.
    Support and ConfidenceSupport (A -> B) = No. of transactions containing A & B ________________________________ No. of total transactions Confidence (A -> B) = No. of transactions containing A & B _________________________________ No. of transactions containing A
  • 7.
  • 8.
    L1 = {large1-itemsetsg} for ( k = 2; Lk !=0, k++ ) do begin Ck = apriori-gen(Lk-1 ); // New candidates for all transactions t Є D do begin Ct = subset (Ck , t); // Candidates contained in t for all candidates c Є Ct do c.count++; end Lk = {c Є Ck | c.count >= minsup} end
  • 9.
  • 10.
    Hash based method Repeat //for each transaction of the database { D = { set of all possible k-itemsets in the ith transaction} For each element of D { Find a unique integer uniq_int using thehash function for k-itemset Increment freq[uniq_int] } Increment trans_pos //Moves pointer to next transaction until end_of_file For (freq_ind=0; freq_ind<length_of_the_array(two_three_freq[]); freq_ind++) { if (freq[freq_ind] >= required support) mark the corresponding k-itemset } }
  • 11.
    Graph based approach Procedure FrequentItemGraph (Tree, F) { scan the DB once to collect the frequent 2-itemsets and their support ascending; add all items in the DB as the header nodes for each 2-itemset entry (top down order) in freq2list do if (first item = item in header node) then create a link to the corresponding header node i=3 for each i-itemsets entry in the tree do call buildsubtree (F) end } Procedure buildsubtree (F) If (first i-1 itemset = itemsets in their respective header nodes) then create a link to the corresponding header node i=i+1 repeat buildsubtree (F) end }
  • 12.
    Example: a cg T4 b c e f g T3 a b c e f g T2 b e T1 Items Transaction
  • 13.
    Conclusion and FutureWork In order to be able to continue with the hashing method, we need a perfect hash function h(e1, e2,…, ek), this hash function can be obtained by one of the following methods: h(e1,e2,…,ek) = prm(1)^e1 + prm(2)^e2 + … + prm(k)^ek Where prm is the set of prime numbers, prm = {2, 3, 5, 7…} Although this hash function guarantee a unique key for every itemset, but it requires an irrational memory space, for example, consider an original item set X with only 10 items, and the following T hashed item set, T = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, consider a 4-itemset (1, 2, 3, 10), this item set will be hashed to the value “282475385”, this will result in reserving large memory space without being used effectively. Other perfect hash functions, used in hashing strings, are not applicable here, because the input variables are limited to 26, which is the number of alphabets, while the number of items in a certain database can be very larger than this.
  • 14.
    Use hashing techniquesto find the efficient frequent 2-itemsets in order to reduce the time and memory requirements to build a graphical structure