Class Itemset


  • public class Itemset
    extends AbstractOrderedItemset
    This class represents an itemset (a set of items) where the itemset is an array of integers sorted by lexical order where no item can appear twice, and the ids of transactions/sequences containing this itemset is represented as a set of integers.
    Author:
    Philippe Fournier-Viger
    • Field Detail

      • itemset

        public int[] itemset
        The list of items contained in this itemset, ordered by lexical order
      • transactionsIds

        public java.util.Set<java.lang.Integer> transactionsIds
        The set of transactions/sequences id containing this itemset
    • Constructor Detail

      • Itemset

        public Itemset()
        Constructor
      • Itemset

        public Itemset​(int item)
        Constructor
        Parameters:
        item - an item that should be added to the new itemset
      • Itemset

        public Itemset​(int[] items)
        Constructor
        Parameters:
        items - an array of items that should be added to the new itemset
    • Method Detail

      • getAbsoluteSupport

        public int getAbsoluteSupport()
        Get the support of this itemset (as an integer)
        Specified by:
        getAbsoluteSupport in class AbstractOrderedItemset
        Returns:
        the support of this itemset
      • getItems

        public int[] getItems()
        Get the items in this itemset as a list.
        Returns:
        the items.
      • get

        public java.lang.Integer get​(int index)
        Get the item at a given position.
        Specified by:
        get in class AbstractOrderedItemset
        Parameters:
        index - the position
        Returns:
        the item
      • setTIDs

        public void setTIDs​(java.util.Set<java.lang.Integer> listTransactionIds)
        Set the list of transaction/sequence ids containing this itemset
        Parameters:
        listTransactionIds - the list of transaction/sequence ids
      • size

        public int size()
        Get the size of this itemset.
        Specified by:
        size in class AbstractOrderedItemset
        Returns:
        the size of this itemset
      • getTransactionsIds

        public java.util.Set<java.lang.Integer> getTransactionsIds()
        Get the list of sequence/transaction ids containing this itemset.
        Returns:
        the list of transaction ids.
      • cloneItemSetMinusAnItemset

        public Itemset cloneItemSetMinusAnItemset​(Itemset itemsetToNotKeep)
        Make a copy of this itemset but exclude a set of items
        Parameters:
        itemsetToNotKeep - the set of items to be excluded
        Returns:
        the copy
      • cloneItemSetMinusOneItem

        public Itemset cloneItemSetMinusOneItem​(java.lang.Integer itemsetToRemove)
        Make a copy of this itemset but exclude a given item
        Parameters:
        itemsetToRemove - the given item
        Returns:
        the copy