relekang / fpgrowth

A java implementation of the FPGrowth algorithm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FPGrowth Build status Coverage status

A java implementation of the FPGrowth algorithm

Usage

Create a jar and run it:

git clone git@github.com:relekang/fpgrowth.git && cd fpgrowth
mvn assembly:assembly
java -jar target/FPGrowth-jar-with-dependencies.jar <path-to-file> <minimum support>

Or use it in code:

double minSupport = 0.9;
boolean pruneTreeOnInsert = true;
Map<Integer, Integer> oneItemsetCounts = FPGrowth.getOneItemsetCounts(transactions);
List<List<Integer> frequentItemsets = FPGrowth.findFrequentItemsetWithSuffix(
  FPGrowth.buildFPTree(transactions, oneItemsetCounts, pruneTreeOnInsert, minSupport),
  new ArrayList<Integer>(),
  ((int) minSupport * transactions.size())
);

MIT © Rolf Erik Lekang

About

A java implementation of the FPGrowth algorithm

License:MIT License


Languages

Language:Java 100.0%