ca.pfv.spmf.algorithms.associationrules.Indirect
Class AlgoINDIRECT
- java.lang.Object
-
- ca.pfv.spmf.algorithms.associationrules.Indirect.AlgoINDIRECT
-
public class AlgoINDIRECT extends java.lang.ObjectThis is an implementation of the INDIRECT algorithm for generating indirect association rules.
The implementation is based on the description in the book: Tan, Steinbach & Kumar (2006) "Introduction to data mining", chapter 7, p. 469, Algorithm 7.2. and the KDD 2000 paper by Tan et al.
However, note that the algorithm is not exactly the same as what the authors did, because there is not enough details in the original paper and in the book. To implement the algorithm, I therefore had to make some choices based on what I tought what the best or easiest way to do it.
Also, note that instead of using the IS measure to compute the dependancy between itemsets, I chose to use the confidence. The confidence is easier to calculate.
Also, note that there is some faster algorithm that exists for generating indirect association rules that have been proposed after INDIRECT (but not implemented in SPMF).
Lastly, note that in my implementation I use an AprioriTID like procedure for generating frequent itemsets that are needed to generate indirect rules. However I do not save the frequent itemsets to file because we don't need to keep them (we just want to generate the indirect rules).
If you find some errors or have some ideas for optimization, please let me know by contacting me on my website.
One possible optimization that I could do in the future would be to use BitSet instead of HashSet to represent the tids sets.
-
-
Constructor Summary
Constructors Constructor and Description AlgoINDIRECT()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidprintStats()Print statistics about the last algorithm execution to System.out.voidrunAlgorithm(java.lang.String input, java.lang.String output, double minsup, double ts, double minconf)Run the algorithm.
-
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm(java.lang.String input, java.lang.String output, double minsup, double ts, double minconf) throws java.lang.NumberFormatException, java.io.IOExceptionRun the algorithm.- Parameters:
input- the input file pathoutput- the output file pathminsup- the minimum support thresholdts- the ts thresholdminconf- the minconf threshold- Throws:
java.io.IOException- exception if there is an error while writing the output file.java.lang.NumberFormatException
-
printStats
public void printStats()
Print statistics about the last algorithm execution to System.out.
-
-
DMelt 3.0 © DataMelt by jWork.ORG