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

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

public final class Distances
extends Object

Author:
Kilian Thiel, University of Konstanz

Method Summary
static double getCorrelationDistance(DataRow row1, DataRow row2, double offset, boolean abs, boolean fuzzy)
          Returns the coefficient of correlation distance between the rows with a given offset.
static double getCorrelationDistance(DataRow row, SotaTreeCell cell, double offset, boolean abs, boolean fuzzy)
          Returns the coefficient of correlation distance between the cells values and the number cells of the given row with a 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 getCosinusDistance(DataRow row, SotaTreeCell cell, double offset, boolean fuzzy)
          Returns the cosinus distance between the cells values and the number cells of the given row with a given offset.
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 getEuclideanDistance(DataRow row, SotaTreeCell cell, boolean fuzzy)
          Returns the euclidean distance between a given DataRow and SotaTreeCell using the Minkowski distance with power 2.
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 getManhattanDistance(DataRow row, SotaTreeCell cell, boolean fuzzy)
          Returns the manhattan distance between a given DataRow and SotaTreeCell using the Minkowski distance with power 1.
static double getMean(DataRow row, boolean fuzzy)
          Returns the mean value of the given row.
static double getMean(SotaTreeCell cell)
          Returns the mean value of the given cell.
static double getMinkowskiDistance(int power, DataRow row1, DataRow row2, boolean fuzzy)
          Calculates the Minkowski distance between two rows.
static double getMinkowskiDistance(int power, DataRow row, SotaTreeCell cell, boolean fuzzy)
          Calculates the Minkowski distance between a regular DataRow and a SotaTreeCell.
static double getStandardDeviation(DataRow row, boolean fuzzy)
          Returns the standard deviation of the given row.
static double getStandardDeviation(SotaTreeCell cell)
          Returns the standard deviation of the given cell.
 
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,
                                          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 row,
                                          SotaTreeCell cell,
                                          boolean fuzzy)
Calculates the Minkowski distance between a regular DataRow and a SotaTreeCell. If fuzzy is set true only columns with cells containing numbers are used to compute the distance. If the number of columns, which are used to compute the distance, contained in the given DataRow is different to the number of cells contained in the given SotaTreeCell, only the first n columns of the DataRow or n cells of the SotaTreeCell are used to compute the distance. The rest is simply ignored. 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.
row - The row to compute the distance.
cell - The cell to compute the distance.
fuzzy - If true only fuzzy data is taken into account, if false only number data.
Returns:
Minkowski distance between the two rows.

getEuclideanDistance

public static double getEuclideanDistance(DataRow row,
                                          SotaTreeCell cell,
                                          boolean fuzzy)
Returns the euclidean distance between a given DataRow and SotaTreeCell using the Minkowski distance with power 2.

Parameters:
row - row to compute the distance
cell - cell to compute the distance
fuzzy - if true only fuzzy data is respected, if false only number data
Returns:
the euclidian distance between given row and cell
See Also:
getMinkowskiDistance(int, DataRow, DataRow, boolean)

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)

getManhattanDistance

public static double getManhattanDistance(DataRow row,
                                          SotaTreeCell cell,
                                          boolean fuzzy)
Returns the manhattan distance between a given DataRow and SotaTreeCell using the Minkowski distance with power 1.

Parameters:
row - row to compute the distance
cell - cell to compute the distance
fuzzy - if true only fuzzy data is respected, if false only number data
Returns:
the euclidian distance between given row and cell
See Also:
getMinkowskiDistance(int, DataRow, DataRow, boolean)

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)

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(DataRow row,
                                        SotaTreeCell cell,
                                        double offset,
                                        boolean fuzzy)
Returns the cosinus distance between the cells values and the number cells of the given row with a given offset.

Parameters:
row - row to compute the cosinus distance of
cell - cell 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 given row and cell

getCorrelationDistance

public static double getCorrelationDistance(DataRow row,
                                            SotaTreeCell cell,
                                            double offset,
                                            boolean abs,
                                            boolean fuzzy)
Returns the coefficient of correlation distance between the cells values and the number cells of the given row with a given offset.

Parameters:
row - row to compute the coefficient of correlation
cell - cell to compute the coefficient of correlation
offset - offset to substract coefficient of correlation from
abs - flags if correlations distance should be used absolute
fuzzy - if true only fuzzy data is respected, if false only number data
Returns:
the coefficient of correlation between given row and cel

getCorrelationDistance

public static double getCorrelationDistance(DataRow row1,
                                            DataRow row2,
                                            double offset,
                                            boolean abs,
                                            boolean fuzzy)
Returns the coefficient of correlation distance between the rows with a given offset.

Parameters:
row1 - first row to compute the coefficient of correlation
row2 - second rell to compute the coefficient of correlation
offset - offset to substract coefficient of correlation from
abs - flags if correlations distance should be used absolute
fuzzy - if true only fuzzy data is respected, if false only number data
Returns:
the coefficient of correlation between given rows

getStandardDeviation

public static double getStandardDeviation(DataRow row,
                                          boolean fuzzy)
Returns the standard deviation of the given row.

Parameters:
row - the row to compute the standard deviation of.
fuzzy - if true only fuzzy data is respected, if false only number data
Returns:
the standard deviation of the given row

getStandardDeviation

public static double getStandardDeviation(SotaTreeCell cell)
Returns the standard deviation of the given cell.

Parameters:
cell - the SotaTreeCell to compute the standard deviation of
Returns:
the standard deviation of the given cell

getMean

public static double getMean(DataRow row,
                             boolean fuzzy)
Returns the mean value of the given row.

Parameters:
row - row to get the mean value of
fuzzy - if true only fuzzy data is respected, if false only number data
Returns:
the mean value of the given row

getMean

public static double getMean(SotaTreeCell cell)
Returns the mean value of the given cell.

Parameters:
cell - SotaTreeCell to get the mean value of
Returns:
the mean value of the given cell


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.