3.23 freqpatA : Enumerate frequent itemsets

Format

$obj$.freqpatA($minsup$) $\rightarrow $ $zdd$

  $minsup$ : integer

Description

Enumerate all frequent itemsets from ZDD object $obj$ that is more than the minimum support $minsup$, and return the ZDD object as $zdd$.

This is a similar LCM function which reads the transaction data from a file and enumerates frequent itemset by LCM algorithm, which is much faster than this function. However, the item name must be specified in whole integers, and the items must be arranged in order, thus if efficiency is not required, this function is sufficient.

Example

Example 1: Basic Example

> require 'zdd'
> a=ZDD::itemset("a")
> b=ZDD::itemset("b")
> c=ZDD::itemset("c")
> d=ZDD::itemset("d")
> t=a*b*c + a*b + a + b*c*d + a
> t.show
 a b c + a b + 2 a + b c d

# At the expression t=a*b*c + a*b + a + b*c*d + a,
# Itemset ab appeared twice in first and second term.
# Itemset a appeared four times in first, second, third, and fifth term.
> t.freqpatA(2).show
 a b + a + b c + b + c + 1

# Maximal itemset (itemsets that are not included in other itemsets)
# Among the frequent itemsets above, a is included in ab, b and c is include in bc,
# Considering 1 will be included in other itemsets, a,b,1 will not be returned as output.
> t.freqpatM(2).show
 a b + b c

# Closed itemsets (emerged itemsets are in the same itemset group as in maximal itemset)
# Among the above frequent itemsets, bc and c appeared as 1st and 4th term.
# The emerged itemsets belong to the same itemset group.
# Within this group, only bc is the maximum.
# Other emumerated closed itemsets emeraged as a different group.
> t.freqpatC(2).show
 a b + a + b c + b + 1

# Run the three functions with a minimum support of 3.
> t.freqpatA(3).show
 a + b + 1
> t.freqpatM(3).show
 a + b
> t.freqpatC(3).show
 a + b + 1

See Also

freqpatM : Enumerate maximal itemsets

freqpatC : Enumerate closed itmesets

lcm : LCM over ZDD