org.knime.base.node.mine.subgroupminer.apriori
Class TIDItemSet

java.lang.Object
  extended by org.knime.base.node.mine.subgroupminer.apriori.TIDItemSet

public final class TIDItemSet
extends Object

The TIDItemSet contains of some TIDItems and a BitSet with their common transaction ids. The BitSet is of the length of the total number of transactions with the bit set, if the items in the set are present in the transaction where the id equals the position in the bitset. When an item is added, the transaction ids are intersected.

Author:
Fabian Dill, University of Konstanz

Method Summary
 void addItem(TIDItem i)
          Adds an item to the set and thereby intersecting the transaction ids.
protected  TIDItemSet clone()
          
static TIDItemSet createEmptyTIDItemSet(String id, int length)
          Creates an empty TIDItemSet with no items but, since it is an empty set, present in all transactions.
 boolean equals(Object o)
          
 BitSet getCommonTIDs()
          Return the transaction ids in which the items in this set appear together as a bitset where the bit is set if the items are present in this transaction.
 String getId()
           
 List<TIDItem> getItems()
           
 double getSupport()
          Returns the support of this set, which is equal to the number of transactions the items in this set appear together in.
 List<Integer> getTIDs()
          Returns the list of tids as a integer list.
 int hashCode()
          
 boolean isSuperSetOf(TIDItemSet s)
           
 FrequentItemSet toFrequentItemSet()
           
 String toString()
          
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

createEmptyTIDItemSet

public static TIDItemSet createEmptyTIDItemSet(String id,
                                               int length)
Creates an empty TIDItemSet with no items but, since it is an empty set, present in all transactions.

Parameters:
id - the current item set ID
length - the number of transactions
Returns:
an empty TIDItemSet with no items but present in all transactions

getId

public String getId()
Returns:
item set ID as string

addItem

public void addItem(TIDItem i)
Adds an item to the set and thereby intersecting the transaction ids.

Parameters:
i - the item to add

getItems

public List<TIDItem> getItems()
Returns:
the items in this set

getSupport

public double getSupport()
Returns the support of this set, which is equal to the number of transactions the items in this set appear together in.

Returns:
the support of this set

getCommonTIDs

public BitSet getCommonTIDs()
Return the transaction ids in which the items in this set appear together as a bitset where the bit is set if the items are present in this transaction. The position of the bit refers to the transaction id.

Returns:
the transaction ids in which the items in this set are present together

getTIDs

public List<Integer> getTIDs()
Returns the list of tids as a integer list.

Returns:
the list of tids as a integer list.

isSuperSetOf

public boolean isSuperSetOf(TIDItemSet s)
Parameters:
s - the set to test
Returns:
true, if this set contains all items of the other set, false otherwise

toFrequentItemSet

public FrequentItemSet toFrequentItemSet()
Returns:
this set as a FrequentItemSet, with the ids as integer and the support

clone

protected TIDItemSet clone()

Overrides:
clone in class Object

equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.