org.knime.base.node.mine.subgroupminer.freqitemset
Class FrequentItemSet

java.lang.Object
  extended by org.knime.base.node.mine.subgroupminer.freqitemset.FrequentItemSet
All Implemented Interfaces:
Iterable<Integer>
Direct Known Subclasses:
TIDFrequentItemSet

public class FrequentItemSet
extends Object
implements Iterable<Integer>

A FrequentItemSet represents items that occur together in a number of transactions. The items are represented with integers as their id. This number directly corresponds to the support. Frequent itemsets can either be free, closed or maximal. Free sets have no other constraint then the minimum support. Closed itemsets have no superset with the same support and maximal itemsets have no frequent superset at all.

Author:
Fabian Dill, University of Konstanz

Nested Class Summary
static class FrequentItemSet.Type
          The type of the frequent itemset.
 
Constructor Summary
FrequentItemSet(String id)
          Creates an empty frequent itemset with no items, support = 0 and neither closed nor maximal.
FrequentItemSet(String id, List<Integer> items)
          Creates frequent itemset with the passed items, support = 0 and neither closed nor maximal.
FrequentItemSet(String id, List<Integer> items, double support)
          Creates a fequent itemset with the passed items and the given support.
FrequentItemSet(String id, List<Integer> items, double support, boolean isClosed, boolean isMaximal)
          Creates a frequent itemset with the passed items, the given support and whether it is closed or maximal.
 
Method Summary
 void add(Integer item)
          Adds the passed item to the set.
 String getId()
           
 List<Integer> getItems()
          Returns a copy of the items in this set.
 double getSupport()
           
 boolean isClosed()
           
 boolean isMaximal()
           
 boolean isSubsetOf(FrequentItemSet s2)
          Returns true, if this itemset is a subset of the passed one, that is, if the passed one contains all items of this set.
 Iterator<Integer> iterator()
           
 void setClosed(boolean isClosed)
          Sets whether this set is closed or not.
 void setItems(List<Integer> items)
          Adds a set of items.
 void setMaximal(boolean isMaximal)
          Sets whether this set is maximal or not.
 void setSupport(double support)
          Sets the support of this set.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FrequentItemSet

public FrequentItemSet(String id)
Creates an empty frequent itemset with no items, support = 0 and neither closed nor maximal.

Parameters:
id - - the id of the itemset

FrequentItemSet

public FrequentItemSet(String id,
                       List<Integer> items)
Creates frequent itemset with the passed items, support = 0 and neither closed nor maximal.

Parameters:
id - the id of this itemset
items - the items constituting this set

FrequentItemSet

public FrequentItemSet(String id,
                       List<Integer> items,
                       double support)
Creates a fequent itemset with the passed items and the given support. Neither closed nor maximal.

Parameters:
id - the id of this itemset
items - the items constituting this set
support - the support of this itemset

FrequentItemSet

public FrequentItemSet(String id,
                       List<Integer> items,
                       double support,
                       boolean isClosed,
                       boolean isMaximal)
Creates a frequent itemset with the passed items, the given support and whether it is closed or maximal. If both, closed and maximal are false it is considered to be free.

Parameters:
id - the id of this itemset
items - the items consituting this itemset.
support - the support of this itemset.
isClosed - true, if this itemset is closed, false otherwise
isMaximal - true if this itemset is maximal, false otherwise
Method Detail

isSubsetOf

public boolean isSubsetOf(FrequentItemSet s2)
Returns true, if this itemset is a subset of the passed one, that is, if the passed one contains all items of this set.

Parameters:
s2 - the frequent itemset to test on
Returns:
true, if this is a subset of the passed one, false otherwise

getId

public String getId()
Returns:
the id of this itemset

add

public void add(Integer item)
Adds the passed item to the set.

Parameters:
item - the item to add to this set

iterator

public Iterator<Integer> iterator()
Specified by:
iterator in interface Iterable<Integer>
Returns:
an iterator over the items

getItems

public List<Integer> getItems()
Returns a copy of the items in this set.

Returns:
a copy of the items in this set

setItems

public void setItems(List<Integer> items)
Adds a set of items.

Parameters:
items - the items to add to this set

isClosed

public boolean isClosed()
Returns:
true, if this itemset is closed, false otherwise

setClosed

public void setClosed(boolean isClosed)
Sets whether this set is closed or not.

Parameters:
isClosed - true, if this set is closed, false otherwise

isMaximal

public boolean isMaximal()
Returns:
true, if this set is maximal, false otherwise

setMaximal

public void setMaximal(boolean isMaximal)
Sets whether this set is maximal or not.

Parameters:
isMaximal - whether this frequent item set is maximal or not

getSupport

public double getSupport()
Returns:
the support of this set

setSupport

public void setSupport(double support)
Sets the support of this set.

Parameters:
support - the support of this set

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.