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

Class Distances

• ```public final class Distances
extends Object```
Author:
Kilian Thiel, University of Konstanz
• Method Summary

All Methods
Modifier and Type Method and Description
`static double` ```getCosinusDistance(DataPoint point1, DataPoint point2, double offset)```
Computes the cosinus distance between the given two `DataPoint`s, 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 `DataPoints`s using the Minkowski distance with power 2.
`static double` ```getEuclideanDistance(DataRow row1, DataRow row2)```
Calculates the euclidean distance between two `DataRow`s using the Minkowski distance with power 2.
`static double` ```getEuclideanDistance(DataRow row1, DataRow row2, boolean fuzzy)```
Calculates the Euclidean distance between two `DataRow`s using the Minkowski distance with power 2.
`static double` ```getManhattanDistance(DataPoint point1, DataPoint point2)```
Calculates the Manhattan distance between two `DataPoints`s using the Minkowski distance with power 1.
`static double` ```getManhattanDistance(DataRow row1, DataRow row2)```
Calculates the Manhattan distance between two `DataRow`s using the Minkowski distance with power 1.
`static double` ```getManhattanDistance(DataRow row1, DataRow row2, boolean fuzzy)```
Calculates the Manhattan distance between two `DataRow`s using the Minkowski distance with power 1.
`static double` ```getMinkowskiDistance(int power, DataPoint point1, DataPoint point2)```
Calculates the Minkowski distance between two `DataPoint`s.
`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 `DataPoint`s. 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 `DataRow`s 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
`getMinkowskiDistance(int, DataRow, DataRow, boolean)`
• getEuclideanDistance

```public static double getEuclideanDistance(DataRow row1,
DataRow row2)```
Calculates the euclidean distance between two `DataRow`s using the Minkowski distance with power 2.
Parameters:
`row1` - the first row
`row2` - the second row
Returns:
distance between the two rows
`getMinkowskiDistance(int, DataRow, DataRow)`
• getEuclideanDistance

```public static double getEuclideanDistance(DataPoint point1,
DataPoint point2)```
Calculates the Euclidean distance between two `DataPoints`s using the Minkowski distance with power 2.
Parameters:
`point1` - The first point
`point2` - The second point
Returns:
distance between the two rows
`getMinkowskiDistance(int, DataPoint, DataPoint)`
• getManhattanDistance

```public static double getManhattanDistance(DataRow row1,
DataRow row2,
boolean fuzzy)```
Calculates the Manhattan distance between two `DataRow`s 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
`getMinkowskiDistance(int, DataRow, DataRow, boolean)`
• getManhattanDistance

```public static double getManhattanDistance(DataRow row1,
DataRow row2)```
Calculates the Manhattan distance between two `DataRow`s using the Minkowski distance with power 1.
Parameters:
`row1` - the first row
`row2` - the second row
Returns:
distance between the two rows
`getMinkowskiDistance(int, DataRow, DataRow)`
• getManhattanDistance

```public static double getManhattanDistance(DataPoint point1,
DataPoint point2)```
Calculates the Manhattan distance between two `DataPoints`s using the Minkowski distance with power 1.
Parameters:
`point1` - The first point
`point2` - The second point
Returns:
distance between the two rows
`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 subtract 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 `DataPoint`s, 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 subtract cosinus distance from
Returns:
the cosinus distance between the given two rows