Documentation of 'jsat.clustering.dissimilarity.AbstractClusterDissimilarity' Java class
AbstractClusterDissimilarity
jsat.clustering.dissimilarity

Class AbstractClusterDissimilarity

    • Constructor Detail

      • AbstractClusterDissimilarity

        public AbstractClusterDissimilarity()
    • Method Detail

      • getDistance

        public static double getDistance(double[][] distanceMatrix,
                                         int i,
                                         int j)
        A convenience method. If the distanceMatrix was created with createDistanceMatrix(jsat.DataSet, jsat.clustering.dissimilarity.ClusterDissimilarity), then this method will return the appropriate value for the desired index.
        Parameters:
        distanceMatrix - the distance matrix to query from
        i - the first index
        j - the second index
        Returns:
        the correct value from the distance matrix from the index given as if the distance matrix was of full form
      • setDistance

        public static void setDistance(double[][] distanceMatrix,
                                       int i,
                                       int j,
                                       double dist)
        A convenience method. If the distanceMatrix was created with createDistanceMatrix(jsat.DataSet, jsat.clustering.dissimilarity.ClusterDissimilarity), then this method will set the appropriate value for the desired index.
        Parameters:
        distanceMatrix - the distance matrix to query from
        i - the first index
        j - the second index
        dist - the new distance value to store in the matrix
      • createDistanceMatrix

        public static double[][] createDistanceMatrix(DataSet dataSet,
                                                      ClusterDissimilarity cd)
        Creates an upper triangular matrix containing the distance between all points in the data set. The main diagonal will contain all zeros, since the distance between a point and itself is always zero. This main diagonal is not stored, and is implicit
        To save space, the matrix is staggered, and is of a size such that all elements to the left of the main diagonal are not present.
        To compute the index into the returned array for the index [i][j], the values should be switched such that i ≥ j, and accessed as [i][j-i-1]
        Parameters:
        dataSet - the data set to create distance matrix for
        cd - the cluster dissimilarity measure to use
        Returns:
        a upper triangular distance matrix

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.