org.knime.base.node.mine.mds.distances
Class Distances

java.lang.Object
  extended by org.knime.base.node.mine.mds.distances.Distances

public final class Distances
extends Object

Author:
Kilian Thiel, University of Konstanz

Method Summary
static double getCosinusDistance(DataPoint point1, DataPoint point2, double offset)
          Computes the cosinus distance between the given two DataPoints, with given offset.
static double getCosinusDistance(DataRow row1, DataRow row2, double offset, boolean fuzzy)
          Computes the cosinus distance between the given two rows, with given offset.
static double getEuclideanDistance(DataPoint point1, DataPoint point2)
          Calculates the euclidean distance between two DataPointss using the Minkowski distance with power 2.
static double getEuclideanDistance(DataRow row1, DataRow row2)
          Calculates the euclidean distance between two DataRows using the Minkowski distance with power 2.
static double getEuclideanDistance(DataRow row1, DataRow row2, boolean fuzzy)
          Calculates the euclidean distance between two DataRows using the Minkowski distance with power 2.
static double getManhattanDistance(DataPoint point1, DataPoint point2)
          Calculates the Manhattan distance between two DataPointss using the Minkowski distance with power 1.
static double getManhattanDistance(DataRow row1, DataRow row2)
          Calculates the Manhattan distance between two DataRows using the Minkowski distance with power 1.
static double getManhattanDistance(DataRow row1, DataRow row2, boolean fuzzy)
          Calculates the Manhattan distance between two DataRows using the Minkowski distance with power 1.
static double getMinkowskiDistance(int power, DataPoint point1, DataPoint point2)
          Calculates the Minkowski distance between two DataPoints.
static double getMinkowskiDistance(int power, DataRow row1, DataRow row2)
          Calculates the Minkowski distance between two rows no matter if they contain fuzzy or number values.
static double getMinkowskiDistance(int power, DataRow row1, DataRow row2, boolean fuzzy)
          Calculates the Minkowski distance between two rows.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMinkowskiDistance

public static double getMinkowskiDistance(int power,
                                          DataPoint point1,
                                          DataPoint point2)
Calculates the Minkowski distance between two DataPoints. The given power specifies the distance kind, i.e. if power is set to 2 the euclidean distance will be computed.

Parameters:
power - The power to use.
point1 - The first point
point2 - The second point
Returns:
Minkowski distance between the two points.

getMinkowskiDistance

public static double getMinkowskiDistance(int power,
                                          DataRow row1,
                                          DataRow row2,
                                          boolean fuzzy)
Calculates the Minkowski distance between two rows. If fuzzy is set true only columns with cells containing numbers are used to compute the distance. The given power specifies the distance kind, i.e. if power is set to 2 the euclidean distance will be computed.

Parameters:
power - The power to use.
row1 - The first row
row2 - The second row
fuzzy - If true only fuzzy data is taken into account, if false only number data.
Returns:
Minkowski distance between the two rows.

getMinkowskiDistance

public static double getMinkowskiDistance(int power,
                                          DataRow row1,
                                          DataRow row2)
Calculates the Minkowski distance between two rows no matter if they contain fuzzy or number values. If they contain fuzzy values, the center of gravity is used as number value, if they contain number values the number is used as value. The given power specifies the distance kind, i.e. if power is set to 2 the euclidean distance will be computed.

Parameters:
power - The power to use.
row1 - The first row
row2 - The second row
Returns:
Minkowski distance between the two rows.

getEuclideanDistance

public static double getEuclideanDistance(DataRow row1,
                                          DataRow row2,
                                          boolean fuzzy)
Calculates the euclidean distance between two DataRows using the Minkowski distance with power 2.

Parameters:
row1 - the first row
row2 - the second row
fuzzy - if true only fuzzy data is respected, if false only number data
Returns:
distance between the two rows
See Also:
getMinkowskiDistance(int, DataRow, DataRow, boolean)

getEuclideanDistance

public static double getEuclideanDistance(DataRow row1,
                                          DataRow row2)
Calculates the euclidean distance between two DataRows using the Minkowski distance with power 2.

Parameters:
row1 - the first row
row2 - the second row
Returns:
distance between the two rows
See Also:
getMinkowskiDistance(int, DataRow, DataRow)

getEuclideanDistance

public static double getEuclideanDistance(DataPoint point1,
                                          DataPoint point2)
Calculates the euclidean distance between two DataPointss using the Minkowski distance with power 2.

Parameters:
point1 - The first point
point2 - The second point
Returns:
distance between the two rows
See Also:
getMinkowskiDistance(int, DataPoint, DataPoint)

getManhattanDistance

public static double getManhattanDistance(DataRow row1,
                                          DataRow row2,
                                          boolean fuzzy)
Calculates the Manhattan distance between two DataRows using the Minkowski distance with power 1.

Parameters:
row1 - the first row
row2 - the second row
fuzzy - if true only fuzzy data is respected, if false only number data
Returns:
distance between the two rows
See Also:
getMinkowskiDistance(int, DataRow, DataRow, boolean)

getManhattanDistance

public static double getManhattanDistance(DataRow row1,
                                          DataRow row2)
Calculates the Manhattan distance between two DataRows using the Minkowski distance with power 1.

Parameters:
row1 - the first row
row2 - the second row
Returns:
distance between the two rows
See Also:
getMinkowskiDistance(int, DataRow, DataRow)

getManhattanDistance

public static double getManhattanDistance(DataPoint point1,
                                          DataPoint point2)
Calculates the Manhattan distance between two DataPointss using the Minkowski distance with power 1.

Parameters:
point1 - The first point
point2 - The second point
Returns:
distance between the two rows
See Also:
getMinkowskiDistance(int, DataPoint, DataPoint)

getCosinusDistance

public static double getCosinusDistance(DataRow row1,
                                        DataRow row2,
                                        double offset,
                                        boolean fuzzy)
Computes the cosinus distance between the given two rows, with given offset.

Parameters:
row1 - first row to compute the cosinus distance of
row2 - second row to compute the cosinus distance of
offset - offset to substract cosinus distance from
fuzzy - if true only fuzzy data is respected, if false only number data
Returns:
the cosinus distance between the given two rows

getCosinusDistance

public static double getCosinusDistance(DataPoint point1,
                                        DataPoint point2,
                                        double offset)
Computes the cosinus distance between the given two DataPoints, with given offset.

Parameters:
point1 - first point to compute the cosinus distance of
point2 - second point to compute the cosinus distance of
offset - offset to substract cosinus distance from
Returns:
the cosinus distance between the given two rows


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.