org.knime.base.node.mine.cluster.assign
Class Prototype

java.lang.Object
  extended by org.knime.base.node.mine.cluster.assign.Prototype

public class Prototype
extends Object

This class represents a prototype.

Author:
cebron, University of Konstanz

Field Summary
static String CFG_COLUMNSUSED
          Key to store the columns used for clustering in the PredParams.
static String CFG_PROTOTYPE
          Name of the config-object, where the Prototypes should be stored.
 
Constructor Summary
Prototype(double[] values)
          Prototype is initialized with double values.
Prototype(double[] values, DataCell classlabel)
          Prototype is initialized with double values and label.
 
Method Summary
 double getDistance(DataRow row)
          Computes the distance between this prototype and a given DataRow.
 double getDistance(DataRow row, int[] indices)
          Computes the distance between this prototype and a given DataRow.
 DataCell getLabel()
           
 double getSquaredEuclideanDistance(DataRow row, int[] indices)
          Computes the distance between this prototype and a given DataRow.
 double[] getValues()
           
static Prototype loadFrom(ModelContentRO model)
           
 void save(ModelContentWO model)
          Saves the Prototype to a ModelContentWO object.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CFG_PROTOTYPE

public static final String CFG_PROTOTYPE
Name of the config-object, where the Prototypes should be stored.

See Also:
Constant Field Values

CFG_COLUMNSUSED

public static final String CFG_COLUMNSUSED
Key to store the columns used for clustering in the PredParams.

See Also:
Constant Field Values
Constructor Detail

Prototype

public Prototype(double[] values)
Prototype is initialized with double values.

Parameters:
values - for initialization.

Prototype

public Prototype(double[] values,
                 DataCell classlabel)
Prototype is initialized with double values and label.

Parameters:
values - of the cluster prototype.
classlabel - of the cluster prototype.
Method Detail

getLabel

public DataCell getLabel()
Returns:
the actual label of the cluster prototype.

getValues

public double[] getValues()
Returns:
actual values of this prototype.

getDistance

public double getDistance(DataRow row,
                          int[] indices)
Computes the distance between this prototype and a given DataRow. Ignores all DataCells that are not compatible to DoubleValue.

Parameters:
row - to compare.
indices - to use.
Returns:
distance value.

getSquaredEuclideanDistance

public double getSquaredEuclideanDistance(DataRow row,
                                          int[] indices)
Computes the distance between this prototype and a given DataRow. Ignores all DataCells that are not compatible to DoubleValue.

Parameters:
row - to compare.
indices - to use.
Returns:
distance value.

getDistance

public double getDistance(DataRow row)
Computes the distance between this prototype and a given DataRow. Ignores all DataCells that are not compatible to DoubleValue.

Parameters:
row - to compare.
Returns:
distance value.

toString

public String toString()

Overrides:
toString in class Object

save

public void save(ModelContentWO model)
Saves the Prototype to a ModelContentWO object.

Parameters:
model - the ModelContent to save to.

loadFrom

public static Prototype loadFrom(ModelContentRO model)
                          throws InvalidSettingsException
Parameters:
model - ModelContent containing information of the Prototype
Returns:
new Prototype
Throws:
InvalidSettingsException - if the settings can not be retrieved.


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.