类 EuclideanDistance


  • public class EuclideanDistance
    extends java.lang.Object
    作者:
    Yaqiang Wang
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      double d​(double[] x, double[] y)
      Euclidean distance between the two arrays of type double.
      double d​(float[] x, float[] y)
      Euclidean distance between the two arrays of type float.
      double d​(int[] x, int[] y)
      Euclidean distance between the two arrays of type integer.
      double[][] proximity​(double[][] data, boolean half)
      eturns the proximity matrix of a dataset for given distance function.
      java.lang.String toString()  
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 构造器详细资料

      • EuclideanDistance

        public EuclideanDistance()
        Constructor. Standard (unweighted) Euclidean distance.
      • EuclideanDistance

        public EuclideanDistance​(double[] weight)
        Constructor with a given weight vector.
        参数:
        weight - the weight vector.
    • 方法详细资料

      • toString

        public java.lang.String toString()
        覆盖:
        toString 在类中 java.lang.Object
      • d

        public double d​(int[] x,
                        int[] y)
        Euclidean distance between the two arrays of type integer. No missing value handling in this method.
      • d

        public double d​(float[] x,
                        float[] y)
        Euclidean distance between the two arrays of type float. NaN will be treated as missing values and will be excluded from the calculation. Let m be the number nonmissing values, and n be the number of all values. The returned distance is sqrt(n * d / m), where d is the square of distance between nonmissing values.
      • d

        public double d​(double[] x,
                        double[] y)
        Euclidean distance between the two arrays of type double. NaN will be treated as missing values and will be excluded from the calculation. Let m be the number nonmissing values, and n be the number of all values. The returned distance is sqrt(n * d / m), where d is the square of distance between nonmissing values.
      • proximity

        public double[][] proximity​(double[][] data,
                                    boolean half)
        eturns the proximity matrix of a dataset for given distance function.
        参数:
        data - Input data
        half - If true, only the lower half of matrix is allocated to save space.
        返回:
        Proximity maxtrix