org.knime.base.node.mine.cluster.hierarchical.distfunctions
Class ManhattanDist
java.lang.Object
org.knime.base.node.mine.cluster.hierarchical.distfunctions.MinkowskiDist
org.knime.base.node.mine.cluster.hierarchical.distfunctions.ManhattanDist
- All Implemented Interfaces:
- Serializable, DistanceFunction
public class ManhattanDist
- extends MinkowskiDist
Calculates the distance for two data rows based on the manhatten distance.
- Author:
- Christoph Sieb, University of Konstanz
- See Also:
- Serialized Form
Constructor Summary |
protected |
ManhattanDist()
Creates a Manhatten distance object from an Minkowski distance
which means the power is one. |
Method Summary |
double |
calcDistance(DataRow firstDataRow,
DataRow secondDataRow,
int[] includedCols)
Calculates the distance between two data rows based on the Manhatten
distance. |
String |
toString()
Returns the String representation of this distance function. |
MANHATTEN_DISTANCE
public static final ManhattanDist MANHATTEN_DISTANCE
- An instance of this distance function.
ManhattanDist
protected ManhattanDist()
- Creates a Manhatten distance object from an Minkowski distance
which means the power is one.
calcDistance
public double calcDistance(DataRow firstDataRow,
DataRow secondDataRow,
int[] includedCols)
- Calculates the distance between two data rows based on the Manhatten
distance.
- Specified by:
calcDistance
in interface DistanceFunction
- Overrides:
calcDistance
in class MinkowskiDist
- Parameters:
firstDataRow
- the first data row used to calculate the distancesecondDataRow
- the second data row used to calculate the distanceincludedCols
- the columns to include into the distance calculation
- Returns:
- the distance of the two rows
toString
public String toString()
- Returns the String representation of this distance function.
- Overrides:
toString
in class MinkowskiDist
- Returns:
- the String representation
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.