简体   繁体   中英

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?

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.

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM