@Override
protected void setup(Context context) throws IOException, InterruptedException {
super.setup(context);
Parameters params = Parameters.fromString(context.getConfiguration().get(
"pfp.parameters", ""));
int i = 0;
for(Pair<String, Long> e: PFPGrowth.deserializeList(params, "fList", context
.getConfiguration()))
{
featureReverseMap.add(e.getFirst());
fMap.put(e.getFirst(), i);
fList.add(new Pair<Integer, Long>(i++, e.getSecond()));
}
Map<String, Long> gList = PFPGrowth.deserializeMap(params, "gList", context
.getConfiguration());
for (Entry<String, Long> entry : gList.entrySet()) {
List<Integer> groupList = groupFeatures.get(entry.getValue());
Integer itemInteger = fMap.get(entry.getKey());
if (groupList != null)
groupList.add(itemInteger);
else {
groupList = new ArrayList<Integer>();
groupList.add(itemInteger);
groupFeatures.put(entry.getValue(), groupList);
}
}
maxHeapSize = Integer.valueOf(params.get("maxHeapSize", "50"));
minSupport = Integer.valueOf(params.get("minSupport", "3"));
FPTreeDepthCache.setFirstLevelCacheSize(Integer.valueOf(params
.get("treeCacheSize", Integer
.toString(FPTreeDepthCache.getFirstLevelCacheSize()))));
}