org.knime.base.node.mine.cluster.fuzzycmeans
Class FCMAlgorithmMemory

java.lang.Object
  extended by org.knime.base.node.mine.cluster.fuzzycmeans.FCMAlgorithm
      extended by org.knime.base.node.mine.cluster.fuzzycmeans.FCMAlgorithmMemory

public class FCMAlgorithmMemory
extends FCMAlgorithm

The Fuzzy c-means algorithm.

Author:
Nicolas Cebron, University of Konstanz

Constructor Summary
FCMAlgorithmMemory(int nrClusters, double fuzzifier)
          Constructor for a Fuzzy c-means algorithm (with no noise detection).
FCMAlgorithmMemory(int nrClusters, double fuzzifier, boolean calculateDelta, double deltalambda)
          Constructor for a Fuzzy c-means algorithm with noise detection.
 
Method Summary
 double doOneIteration(ExecutionContext exec)
          Does one iteration in the Fuzzy c-means algorithm.
 double[][] getConvertedData()
          Please make sure to call init() first in order to guarantee that the DataTable is converted.
 double[][] getConvertedData(DataTable table)
           
 RowKey[] getRowKeys()
          Please make sure to call init() first in order to guarantee that the DataTable is converted.
 void init(int nrRows, int dimension, DataTable table)
          Inits the cluster centers and the weight matrix.
 void init(RowKey[] keys, double[][] data)
          Inits the cluster centers and the weight matrix.
 
Methods inherited from class org.knime.base.node.mine.cluster.fuzzycmeans.FCMAlgorithm
addTotalChange, getClusterCentres, getClusters, getDelta, getDimension, getFuzzifier, getLambda, getNrClusters, getNrRows, getTotalChange, getweightMatrix, getWeightMatrix, getWinner, init, isCalculateDelta, isNoise, noiseClustering, setClusterValue, setDelta, setTotalChange, setWeightMatrixValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FCMAlgorithmMemory

public FCMAlgorithmMemory(int nrClusters,
                          double fuzzifier)
Constructor for a Fuzzy c-means algorithm (with no noise detection).

Parameters:
nrClusters - the number of cluster prototypes to use
fuzzifier - allows the clusters to overlap

FCMAlgorithmMemory

public FCMAlgorithmMemory(int nrClusters,
                          double fuzzifier,
                          boolean calculateDelta,
                          double deltalambda)
Constructor for a Fuzzy c-means algorithm with noise detection. It can be indicated, whether the delta value of the noise cluster should be updated automatically or if it should be calculated automatically. The last parameter specifies either the delta value or the lambda value, depending on the boolean flag in the parameter before.

Parameters:
nrClusters - the number of clusters to use
fuzzifier - the fuzzifier, controls how much the clusters can overlap
calculateDelta - indicate whether delta should be calculated automatically
deltalambda - the delta value, if the previous parameter is false, the lambda value otherwise
Method Detail

init

public void init(int nrRows,
                 int dimension,
                 DataTable table)
Inits the cluster centers and the weight matrix. Must be called before the iterations are carried out.

Overrides:
init in class FCMAlgorithm
Parameters:
nrRows - number of rows in the DataTable
dimension - the dimension of the table
table - the table to use.

init

public void init(RowKey[] keys,
                 double[][] data)
Inits the cluster centers and the weight matrix. Must be called before the iterations are carried out.

Parameters:
keys - the RowKeys for each data row.
data - the DaaTable as 2 dimensional double array.

getConvertedData

public double[][] getConvertedData()
Please make sure to call init() first in order to guarantee that the DataTable is converted.

Returns:
the input DataTable converted as a double array. If it has not been produced yet, null is returned.

getConvertedData

public double[][] getConvertedData(DataTable table)
Parameters:
table - DataTable to convert.
Returns:
two-dimensional double array.

getRowKeys

public RowKey[] getRowKeys()
Please make sure to call init() first in order to guarantee that the DataTable is converted.

Returns:
the RowKeys assigned to each position of the produced double array
See Also:
getConvertedData()

doOneIteration

public double doOneIteration(ExecutionContext exec)
                      throws CanceledExecutionException
Does one iteration in the Fuzzy c-means algorithm. First, the weight matrix is updated and then the cluster prototypes are recalculated.

Overrides:
doOneIteration in class FCMAlgorithm
Parameters:
exec - execution context to cancel the execution
Returns:
the total change in the cluster prototypes. Allows to decide whether the algorithm can be stopped.
Throws:
CanceledExecutionException - if the operation is canceled


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.