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

java.lang.Object
  extended by org.knime.base.node.mine.subgroupminer.freqitemset.FrequentItemSetRow
All Implemented Interfaces:
Iterable<DataCell>, DataRow

public class FrequentItemSetRow
extends Object
implements DataRow

This class implements one row of a FrequentItemSetTable. Beside the normal DataRow functionality it provides information about the length of the frequent item set, the support of it, whether it is closed, resp. maximal or not. Each item in the set is realised as a StringValue (the name of the item).

Author:
Fabian Dill, University of Konstanz

Constructor Summary
FrequentItemSetRow(RowKey key, List<String> items, int length, double support)
          Creates a FrequentItemSetRow from the passed arguments.
FrequentItemSetRow(RowKey key, List<String> items, int length, double support, boolean isClosed, boolean isMaximal)
          Creates a FrequentItemSetRow from the passed arguments.
 
Method Summary
 Set<String> asSet()
          Returns the items as a set of Strings.
static Set<String> extractItemNamesFrom(DefaultRow row)
          Extracts the itemset names from a Default row, which was a former itemset row.
 DataCell getCell(int index)
          Returns the DataCell at the provided index within this row.
 RowKey getKey()
          Returns the row key.
 int getNumCells()
          Returns the length of this row, that is the number of columns of the DataTable (not including the row key).
 int getSetLength()
          Returns the number of items in the represented frequent itemset.
 double getSupport()
          Returns the support of the represented frequent itemset.
static double getSupportFrom(DefaultRow row)
          Returns the support of a former frequent itemset row.
 boolean isClosed()
          Returns whether the represented itemset is closed or not.
 boolean isMaximal()
           
 Iterator<DataCell> iterator()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrequentItemSetRow

public FrequentItemSetRow(RowKey key,
                          List<String> items,
                          int length,
                          double support,
                          boolean isClosed,
                          boolean isMaximal)
Creates a FrequentItemSetRow from the passed arguments.

Parameters:
key - the unique row key
items - the names of the items in the set as strings
length - the length of the item set (which might be different from the length of the row!)
support - the support of the item set
isClosed - true if the item set is closed, false otherwise
isMaximal - true if the set is maximal, false otherwise

FrequentItemSetRow

public FrequentItemSetRow(RowKey key,
                          List<String> items,
                          int length,
                          double support)
Creates a FrequentItemSetRow from the passed arguments. It is assumed that this item set is neither closed nor maximal: these values will be set to false.

Parameters:
key - the unique row key
items - the names of the items in the set as strings
length - the length of the item set (which might be different from the length of the row!)
support - the support of the item set
Method Detail

extractItemNamesFrom

public static Set<String> extractItemNamesFrom(DefaultRow row)
Extracts the itemset names from a Default row, which was a former itemset row.

Parameters:
row - a former frequent itemset row
Returns:
the names of the itemset of a former itemset row

getSupportFrom

public static double getSupportFrom(DefaultRow row)
Returns the support of a former frequent itemset row.

Parameters:
row - a former frequent itemset row
Returns:
the support of a former frequent itemset row

getNumCells

public int getNumCells()
Returns the length of this row, that is the number of columns of the DataTable (not including the row key).

Specified by:
getNumCells in interface DataRow
Returns:
length of this row

iterator

public Iterator<DataCell> iterator()

Specified by:
iterator in interface Iterable<DataCell>

getKey

public RowKey getKey()
Returns the row key.

Specified by:
getKey in interface DataRow
Returns:
the row key

getCell

public DataCell getCell(int index)
Returns the DataCell at the provided index within this row.

Specified by:
getCell in interface DataRow
Parameters:
index - the index of the cell to retrieve (indices start from 0)
Returns:
the DataCell at the given index

getSupport

public double getSupport()
Returns the support of the represented frequent itemset.

Returns:
the support of the represented frequent itemset

getSetLength

public int getSetLength()
Returns the number of items in the represented frequent itemset.

Returns:
the number of items in the represented frequent itemset

asSet

public Set<String> asSet()
Returns the items as a set of Strings.

Returns:
the items as a set of Strings

isClosed

public boolean isClosed()
Returns whether the represented itemset is closed or not.

Returns:
whether the represented itemset is closed or not

isMaximal

public boolean isMaximal()
Returns:
whether the represented frequent itemset is maximal or not


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.