use of org.knime.base.node.mine.subgroupminer.freqitemset.TIDFrequentItemSet in project knime-core by knime.
the class TIDApriori method getFrequentItemSets.
/**
* {@inheritDoc}
*/
@Override
public List<FrequentItemSet> getFrequentItemSets(final FrequentItemSet.Type type) {
List<FrequentItemSet> freqSets = new ArrayList<FrequentItemSet>();
List<Integer> tids = new ArrayList<Integer>();
for (int i = 0; i < m_dbsize; i++) {
tids.add(i);
}
for (TIDItem i : m_alwaysFrequentItems) {
List<Integer> id = new ArrayList<Integer>();
id.add(i.getId());
TIDFrequentItemSet freqSet = new TIDFrequentItemSet(Integer.toString(m_idCounter++), id, 1.0, tids);
freqSets.add(freqSet);
}
if (type.equals(FrequentItemSet.Type.FREE)) {
getFrequentItemSets(m_prefixTree, freqSets);
} else if (type.equals(FrequentItemSet.Type.CLOSED)) {
freqSets.addAll(getClosedItemSets());
} else if (type.equals(FrequentItemSet.Type.MAXIMAL)) {
freqSets.addAll(getMaximalItemSets());
}
return freqSets;
}
Aggregations