16

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?

Roman C
  • 49,761
  • 33
  • 66
  • 176
ŁukaszBachman
  • 33,595
  • 11
  • 64
  • 74

2 Answers2

23

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.

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
ŁukaszBachman
  • 33,595
  • 11
  • 64
  • 74
  • 3
    Here's a slight longer explanation: "FP-Growth algorithm works for boolean values only. Hence, the attributes of the dataset can have only true or false values. If you are using different type of attributes (numeric, string etc.), it looks disabled." http://weka.8497.n7.nabble.com/FP-GROWTH-Algorithm-td23554.html – guerda Jun 14 '15 at 09:02
2

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);
Venkata Gogu
  • 1,021
  • 10
  • 25