Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are data requirements for FP-Growth in Weka?

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?

like image 950
ŁukaszBachman Avatar asked Jan 12 '13 12:01

ŁukaszBachman


People also ask

What is FP growth in data mining?

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.

How do you construct a FP tree in data mining?

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.

How FP growth algorithm works explain?

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.

What is the difference between Apriori and FP growth algorithm?

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.


2 Answers

The answer/solution:

  1. Each algorithm that Weka implements has some sort of a summary info associated with it. In order to see it from the GUI, one has to click on algorithm (or filter) options and then click once more on Capabilities button. Then a small popup will show up containing some info regarding particular algorithm.
  2. In case of 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.

like image 70
ŁukaszBachman Avatar answered Sep 27 '22 02:09

ŁukaszBachman


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);
like image 29
Venkata Gogu Avatar answered Sep 24 '22 02:09

Venkata Gogu