Class SparseItemset

  • All Implemented Interfaces:
    java.lang.Comparable<Itemset>

    public class SparseItemset
    extends Itemset
    Frequent itemset, sparse representation.
    Since:
    0.7.0
    Author:
    Erich Schubert
    • Field Detail

      • indices

        int[] indices
        Items, as indexes.
    • Constructor Detail

      • SparseItemset

        public SparseItemset​(int[] indices)
        Constructor.
        Parameters:
        indices - Items
      • SparseItemset

        public SparseItemset​(int[] indices,
                             int support)
        Constructor with initial support.
        Parameters:
        indices - Items
        support - Support
      • SparseItemset

        public SparseItemset​(OneItemset ii,
                             OneItemset ij)
        Constructor from existing itemsets.
        Parameters:
        ii - First 1-itemset
        ij - Second 1-itemset
    • Method Detail

      • length

        public int length()
        Description copied from class: Itemset
        Itemset length.
        Specified by:
        length in class Itemset
        Returns:
        Itemset length
      • iter

        public int iter()
        Description copied from class: Itemset
        Get an iterator over items, usually the position within an array. Intended usage:
         
         for (int iter = v.iter(); v.iterValid(iter); iter = v.iterAdvance(iter)) {
           final int item = v.iterItem(iter);
           // Do something.
         }
         
         
        Specified by:
        iter in class Itemset
        Returns:
        Iterator
      • iterValid

        public boolean iterValid​(int iter)
        Description copied from class: Itemset
        Check if the iterator position is valid.
        Specified by:
        iterValid in class Itemset
        Parameters:
        iter - Iterator
        Returns:
        true if the position is valid.
      • iterAdvance

        public int iterAdvance​(int iter)
        Description copied from class: Itemset
        Advance the iterator to the next position.
        Specified by:
        iterAdvance in class Itemset
        Parameters:
        iter - Iterator
        Returns:
        New iterator position
      • iterDim

        public int iterDim​(int iter)
        Description copied from class: Itemset
        Item at the iterator position.
        Specified by:
        iterDim in class Itemset
        Parameters:
        iter - Iterator
        Returns:
        Current item
      • compareTo

        public int compareTo​(Itemset o)
        Specified by:
        compareTo in interface java.lang.Comparable<Itemset>
        Overrides:
        compareTo in class Itemset
      • prefixTest

        public boolean prefixTest​(SparseItemset other)
        Perform the prefix test for sparse itemset.
        Parameters:
        other - Other itemset
        Returns:
        true iff the first n-1 items agree.