| Input:Am×n, Minsup |
for (k = 2, Lk-1≠; k++)//Generating frequent k item sets from frequent k-1 item sets |
begin |
C_k = apriori_gen (Lk-1);//Call the apriori_gen function to generate Ck by Lk-1 |
For all transactions T ∈ Ddo |
begin |
Ct = subset (Ck, t);//t contains the candidate set |
For all candidates C ∈ CT |
mi = M (,i1) M (,i2)//Calculate the vector inner product of the corresponding items in the candidate set, where i is the number of columns of matrix A. |
qi = COUNT (mi)//Statistics the summary of column i items |
If qi < Minsup Then Delect, I//calculate to generate Am,n-x row intersection matrix Cm×m m. |
k = k + 1 |
Go To Line3 |
Lk = {c ∈ Ct│c.qi ≥ Minsup}//Output frequent itemset L |
Output:LEND |
apriori_gen |
selectp.it1,p.it2,…,p.itk-1from Lk-1p,.Lk-1q, |
Wherep.it1 = p.it2,…,p.itk-2 = p.itk-2,p.itk-1<p.itk-1; |
For all itsets c ∈ Ck do//pruning step |
If c ∉ Lk-1or c ∈ Anti_B_R//If it does not belong to Lk-1 or violates the rules of correspondence between accounting direction and account |
Then delete c from Ck//Delete c |
End |