From: Khalid Iqbal on 18 Jan 2010 12:30 Dear Friends I need to implement apriori algorithm in Matlab. For this purpose, I using 5 attrubutes such as A B C D E T1 1 0 1 0 0 T2 1 1 1 0 1 T3 0 1 0 1 1 T4 1 1 1 0 1 T5 1 1 1 1 1 T6 0 1 0 1 0 The attributes represents the presence or absence of their occurence in a transaction. the minimum support is set (e.g. min_support=4) and support of each attribute is calculated in order to generate candidate set. support(A)=4, Support(B)=5, Support(C)=4,Support(D)=3 and Support(E)=4. SO we take those attributes in the next step which support is more than the min_support. Thus D is eliminated. So culumns left are A B C E T1 1 0 1 0 T2 1 1 1 1 T3 0 1 0 1 T4 1 1 1 1 T5 1 1 1 1 T6 0 1 0 0 Now check the support(AB), Support(AC), support(AE), Support(BC), Support(BE) and support(CE). This can be checked using AND operator. If the suppport calculated is more or equal to the min_support then the attributes satisfying the min_spport threshold will go in the next round. Now the support(ABC), Support(ABE) and Support(BCE will be checked against the min_support. Finally support(ABCE) will checked against the min_support. Finally Association Rules will be displayed as below. Rule# Assciation Rules Support Confidence =Support(AuB)/Support(A) 1 A==> B 40% 75% 2 A,B ==> E 50% 82% ..... .......... ...... ....... ...... .......... ...... ....... ..... .......... ...... ........ Please if someone know about this implementation in Matlab. Let me know the code in Matlab. Thanks in advance Khalid
|
Pages: 1 Prev: plotting timeseries with data gaps Next: Change the variable used for each loop? |