Package fim

Class CloMaxFilter

java.lang.Object
fim.CloMaxFilter

public class CloMaxFilter extends Object
Class for filter repository for closed and maximal item patterns. The repository takes the form of a chain of CloMaxTree.
Since:
2016.10.24 /*--------------------------------------------------------------------
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    target pattern subtype: closed frequent item patterns; to be combined with SEQUENCE
    int
    the direction of the item order
    static final int
    target pattern subtype: simple frequent item patterns
    util.IdMap
    the underlying item base
    static final int
    target pattern type: item sets (item order is ignored)
    static final int
    target pattern subtype: maximal frequent item patterns; to be combined with SEQUENCE
    static final int
    target pattern type: paths represent (general) sequences (with and without repetition)
    int
    the current number of prefix trees
    static final int
    target pattern subtype mask; to extract the target pattern subtype, that is, CLOSED or MAXIMAL
    int
    the target type of the filtering; SEQUENCE as the main target pattern type and either FREQUENT, CLOSED or MAXIMAL as the target pattern subtype
    the chain of (conditional) prefix trees
    static final int
    target pattern type mask; to extract the main target pattern type, that is, SEQUENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    CloMaxFilter(util.IdMap ibase, int target)
    Create a closed/maximal filter (in the form of a prefix tree chain/hierarchy).
    CloMaxFilter(util.IdMap ibase, int target, int dir)
    Create a closed/maximal filter (in the form of a prefix tree chain/hierarchy).
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    add(int item)
    Add an item to the current prefix (involves projecting the last prefix tree to the item).
    final void
    addItem(int item)
    Add an item to the current prefix (involves projecting the last prefix tree to the item).
    final void
    Clear the closed/maximal filter.
    final int
    Get the support of the current prefix.
    Retrieve one of the prefix trees of the prefix tree chain.
    getTree(int index)
    Retrieve one of the prefix trees of the prefix tree chain.
    final void
    Remove an item from the current prefix.
    final void
    remove(int cnt)
    Remove items from the current prefix.
    final void
    Remove an item from the current prefix.
    Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).
    report(int s_base)
    Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).
    report(int s_base, int zmin, int zmax)
    Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).
    Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).
    report(PatternReceiver patrec, int s_base)
    Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).
    report(PatternReceiver patrec, int s_base, int zmin, int zmax)
    Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).
    final boolean
    update(int[] items, int cnt, int supp)
    Update a closed/maximal filter with a new item pattern (that is, remove all item patterns that are subpatterns of this pattern [for maximal pattern filtering] or subpatterns with the same support [for closed pattern filtering] and add the pattern to the filter unless it is subsumed [is a subpattern or a subpattern with the same support, respectively] by an item pattern in the filter).
    final boolean
    update(int[] items, int cnt, int supp, boolean prune)
    Update a closed/maximal filter with a new item pattern (that is, remove all item patterns that are subpatterns of this pattern [for maximal pattern filtering] or subpatterns with the same support [for closed pattern filtering] and add the pattern to the filter unless it is subsumed [is a subpattern or a subpattern with the same support, respectively] by an item pattern in the filter).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TYPEMASK

      public static final int TYPEMASK
      target pattern type mask; to extract the main target pattern type, that is, SEQUENCE
      See Also:
    • SUBTYPEMASK

      public static final int SUBTYPEMASK
      target pattern subtype mask; to extract the target pattern subtype, that is, CLOSED or MAXIMAL
      See Also:
    • ITEMSET

      public static final int ITEMSET
      target pattern type: item sets (item order is ignored)
      See Also:
    • SEQUENCE

      public static final int SEQUENCE
      target pattern type: paths represent (general) sequences (with and without repetition)
      See Also:
    • FREQUENT

      public static final int FREQUENT
      target pattern subtype: simple frequent item patterns
      See Also:
    • CLOSED

      public static final int CLOSED
      target pattern subtype: closed frequent item patterns; to be combined with SEQUENCE
      See Also:
    • MAXIMAL

      public static final int MAXIMAL
      target pattern subtype: maximal frequent item patterns; to be combined with SEQUENCE
      See Also:
    • ibase

      public util.IdMap ibase
      the underlying item base
    • target

      public int target
      the target type of the filtering; SEQUENCE as the main target pattern type and either FREQUENT, CLOSED or MAXIMAL as the target pattern subtype
    • dir

      public int dir
      the direction of the item order
    • size

      public int size
      the current number of prefix trees
    • trees

      public CloMaxTree[] trees
      the chain of (conditional) prefix trees
  • Constructor Details

    • CloMaxFilter

      public CloMaxFilter(util.IdMap ibase, int target, int dir)
      Create a closed/maximal filter (in the form of a prefix tree chain/hierarchy).
      Parameters:
      ibase - the underlying item base
      target - the target pattern type of the prefix tree (main target pattern type SEQUENCE and target pattern subtype CLOSED or MAXIMAL
      dir - the direction of the item order
      Since:
      2017.06.22 (Christian Borgelt)
    • CloMaxFilter

      public CloMaxFilter(util.IdMap ibase, int target)
      Create a closed/maximal filter (in the form of a prefix tree chain/hierarchy).
      Parameters:
      ibase - the underlying item base
      target - the target pattern type of the prefix tree (main target pattern type SEQUENCE and target pattern subtype CLOSED or MAXIMAL
      Since:
      2017.06.22 (Christian Borgelt)
  • Method Details

    • clear

      public final void clear()
      Clear the closed/maximal filter.
      Since:
      2017.06.22 (Christian Borgelt)
    • getSupp

      public final int getSupp()
      Get the support of the current prefix.
      Returns:
      the support of the current prefix
      Since:
      2017.06.22 (Christian Borgelt)
    • getTree

      public final CloMaxTree getTree(int index)
      Retrieve one of the prefix trees of the prefix tree chain.
      Parameters:
      index - the index of the prefix tree to retrieve
      Returns:
      the prefix tree with index index
      Since:
      2017.06.22 (Christian Borgelt)
    • getTree

      public final CloMaxTree getTree()
      Retrieve one of the prefix trees of the prefix tree chain.
      Returns:
      the first prefix tree of the prefix tree chain
      Since:
      2017.06.22 (Christian Borgelt)
    • add

      public final void add(int item)
      Add an item to the current prefix (involves projecting the last prefix tree to the item).
      Parameters:
      item - the item to add to the current prefix
      Since:
      2017.06.22 (Christian Borgelt)
    • addItem

      public final void addItem(int item)
      Add an item to the current prefix (involves projecting the last prefix tree to the item).
      Parameters:
      item - the item to add to the current prefix
      Since:
      2017.06.22 (Christian Borgelt)
    • remove

      public final void remove(int cnt)
      Remove items from the current prefix.
      Parameters:
      cnt - the number of items to remove from the current prefix
      Since:
      2017.06.22 (Christian Borgelt)
    • remove

      public final void remove()
      Remove an item from the current prefix.
      Since:
      2017.06.22 (Christian Borgelt)
    • removeItem

      public final void removeItem()
      Remove an item from the current prefix.
      Since:
      2017.06.22 (Christian Borgelt)
    • update

      public final boolean update(int[] items, int cnt, int supp, boolean prune)
      Update a closed/maximal filter with a new item pattern (that is, remove all item patterns that are subpatterns of this pattern [for maximal pattern filtering] or subpatterns with the same support [for closed pattern filtering] and add the pattern to the filter unless it is subsumed [is a subpattern or a subpattern with the same support, respectively] by an item pattern in the filter).
      Parameters:
      items - the item pattern to add
      cnt - the number of items in the pattern to add
      supp - the support of the item pattern to add
      prune - whether to prune sub- or super-patterns (depending on the target type) from the prefix tree
      Returns:
      whether the given pattern was added to the filter
      Since:
      2017.06.22 (Christian Borgelt)
    • update

      public final boolean update(int[] items, int cnt, int supp)
      Update a closed/maximal filter with a new item pattern (that is, remove all item patterns that are subpatterns of this pattern [for maximal pattern filtering] or subpatterns with the same support [for closed pattern filtering] and add the pattern to the filter unless it is subsumed [is a subpattern or a subpattern with the same support, respectively] by an item pattern in the filter).
      Parameters:
      items - the item pattern to add
      cnt - the number of items in the pattern to add
      supp - the support of the item pattern to add
      Returns:
      whether the given pattern was added to the filter
      Since:
      2017.06.22 (Christian Borgelt)
    • report

      public final PatternSet report(int s_base, int zmin, int zmax)
      Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).
      Parameters:
      s_base - the base support (support of the empty item pattern); if -1, the root node supportis used, if -2, the item pattern support is used
      zmin - the minimum size of an item pattern (number of items)
      zmax - the maximum size of an item pattern (number of items)
      Returns:
      the set of closed or maximal item patterns
      Since:
      2017.06.22 (Christian Borgelt)
    • report

      public final PatternSet report(int s_base)
      Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).
      Parameters:
      s_base - the base support (support of the empty item pattern); if -1, the root node supportis used, if -2, the item pattern support is used
      Returns:
      the set of closed or maximal item patterns
      Since:
      2017.06.22 (Christian Borgelt)
    • report

      public final PatternSet report()
      Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).
      Returns:
      the set of closed or maximal item patterns
      Since:
      2017.06.22 (Christian Borgelt)
    • report

      public final PatternReceiver report(PatternReceiver patrec)
      Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).
      Parameters:
      patrec - the receiver for collecting the item patterns
      Returns:
      the set of closed or maximal item patterns
      Since:
      2017.06.22 (Christian Borgelt)
    • report

      public final PatternReceiver report(PatternReceiver patrec, int s_base)
      Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).
      Parameters:
      patrec - the receiver for collecting the item patterns
      s_base - the base support (support of the empty item pattern); if -1, the root node support is used, if -2, the item pattern support is used
      Returns:
      the set of closed or maximal item patterns
      Since:
      2017.06.22 (Christian Borgelt)
    • report

      public final PatternReceiver report(PatternReceiver patrec, int s_base, int zmin, int zmax)
      Report closed or maximal item patterns (type is determined by the parameters passed to the constructor).
      Parameters:
      patrec - the receiver for collecting the item patterns
      s_base - the base support (support of the empty item pattern); if -1, the root node support is used, if -2, the item pattern support is used
      zmin - the minimum size of an item pattern (number of items)
      zmax - the maximum size of an item pattern (number of items)
      Returns:
      the set of closed or maximal item patterns
      Since:
      2017.06.22 (Christian Borgelt)