I'd like to use FP-Growth association rule algorithm on my dataset (model) in Weka.
Unfortunately, this algorithm is greyed out. What are preconditions I have to meet in order to make use of it?
Frequent pattern-growth (FP-Growth) is the mining of pattern itemsets, subsequences, and substructures that appear frequently in a dataset. A Frequent itemset refers to the most common items bought together. A Subsequence where items are bought by a customer is called a frequent sequential pattern.
The construction of a FP-tree is subdivided into three major steps. Scan the data set to determine the support count of each item, discard the infrequent items and sort the frequent items in decreasing order. Scan the data set one transaction at a time to create the FP-tree.
It works on the principle, “the non-empty subsets of frequent itemsets must also be frequent”. It forms k-itemset candidates from (k-1) itemsets and scans the database to find the frequent itemsets. Frequent Pattern Growth Algorithm is the method of finding frequent patterns without candidate generation.
The distinction between the two algorithms is that the Apriori algorithm generates candidate frequent itemsets and also the FP-growth algorithm avoids candidate generation and it develops a tree by economical and efficient 'divide and conquer' strategy.
The answer/solution:
Capabilities
button. Then a small popup will show up containing some info regarding particular algorithm.FPGrowth
- model attributes needs to be of binary
type. In my case I had a mix od nominal and numeric parameters. I had to apply NominalToBinary
filter which converted my nominal attributes to binary values. Then I had to apply flter NumericToBinary
with selected option ignoreClass
set to true
.This has helped me to "unlock" FPGrowth
in Weka.
Adding to @ŁukaszBachman answer:
You need to set class to "No Class" before applying filter operation. If you are using weka java api, then you need to add data.setClassIndex(-1)
to your java code.
For example: To perform Nominal To Binary in Java:
NominalToBinary nn = new NominalToBinary();
nn.setInputFormat(Data);
Data.setClassIndex(-1);
Data = Filter.useFilter(Data, nn);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With