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

Class LanceWilliamsDissimilarity

    • Constructor Detail

      • LanceWilliamsDissimilarity

        public LanceWilliamsDissimilarity(DistanceMetric dm)
        Creates a new LW dissimilarity measure using the given metric as the base distance between individual points.
        Parameters:
        dm - the base metric to measure dissimilarity from.
      • LanceWilliamsDissimilarity

        public LanceWilliamsDissimilarity(LanceWilliamsDissimilarity toCopy)
        Copy constructor
        Parameters:
        toCopy - the object to copy
    • Method Detail

      • dissimilarity

        public double dissimilarity(java.util.List<DataPoint> a,
                                    java.util.List<DataPoint> b)
        Description copied from interface: ClusterDissimilarity
        Provides the notion of dissimilarity between two sets of points, that may not have the same number of points.
        Specified by:
        dissimilarity in interface ClusterDissimilarity
        Parameters:
        a - the first cluster of points
        b - the second cluster of points
        Returns:
        a value >= 0 that describes the dissimilarity of the two clusters. The larger the value, the more different the two clusterings are.
      • dissimilarity

        public double dissimilarity(java.util.Set<java.lang.Integer> a,
                                    java.util.Set<java.lang.Integer> b,
                                    double[][] distanceMatrix)
        Description copied from interface: ClusterDissimilarity
        Provides the notion of dissimilarity between two sets of points, that may not have the same number of points. This is done using a matrix containing all pairwise distance computations between all points.
        Specified by:
        dissimilarity in interface ClusterDissimilarity
        Parameters:
        a - the first set of indices of the original data set that are in a cluster, which map to distanceMatrix
        b - the second set of indices of the original data set that are in a cluster, which map to distanceMatrix
        distanceMatrix - the upper triangual distance matrix as created by AbstractClusterDissimilarity.createDistanceMatrix(jsat.DataSet, jsat.clustering.dissimilarity.ClusterDissimilarity)
        Returns:
        a value >= 0 that describes the dissimilarity of the two clusters. The larger the value, the more different the two clusterings are.
      • dissimilarity

        public double dissimilarity(int i,
                                    int ni,
                                    int j,
                                    int nj,
                                    double[][] distanceMatrix)
        Description copied from interface: UpdatableClusterDissimilarity
        Provides the notion of dissimilarity between two sets of points, that may not have the same number of points. This is done using a matrix containing all pairwise distance computations between all points. This distance matrix will then be updated at each iteration and merging, leaving empty space in the matrix. The updates will be done by the clustering algorithm. Implementing this interface indicates that this dissimilarity measure can be accurately computed in an updatable manner that is compatible with a Lance–Williams update.
        Specified by:
        dissimilarity in interface UpdatableClusterDissimilarity
        Parameters:
        i - the index of cluster i's distance in the original data set
        ni - the number of items in the cluster represented by i
        j - the index of cluster j's distance in the original data set
        nj - the number of items in the cluster represented by j
        distanceMatrix - a distance matrix originally created by AbstractClusterDissimilarity.createDistanceMatrix(jsat.DataSet, jsat.clustering.dissimilarity.ClusterDissimilarity)
        Returns:
        a value >= 0 that describes the dissimilarity of the two clusters. The larger the value, the more different the two clusterings are.
      • dissimilarity

        public double dissimilarity(int i,
                                    int ni,
                                    int j,
                                    int nj,
                                    int k,
                                    int nk,
                                    double[][] distanceMatrix)
        Description copied from interface: UpdatableClusterDissimilarity
        Provides the notion of dissimilarity between two sets of points, that may not have the same number of points. This is done using a matrix containing all pairwise distance computations between all points. This distance matrix will then be updated at each iteration and merging, leaving empty space in the matrix. The updates will be done by the clustering algorithm. Implementing this interface indicates that this dissimilarity measure can be accurately computed in an updatable manner that is compatible with a Lance–Williams update.
        This computes the dissimilarity of the union of clusters i and j, (Ci ∪ Cj), with the cluster k. This method is used by other algorithms to perform an update of the distance matrix in an efficient manner.
        Specified by:
        dissimilarity in interface UpdatableClusterDissimilarity
        Parameters:
        i - the index of cluster i's distance in the original data set
        ni - the number of items in the cluster represented by i
        j - the index of cluster j's distance in the original data set
        nj - the number of items in the cluster represented by j
        k - the index of cluster k's distance in the original data set
        nk - the number of items in the cluster represented by k a distance matrix originally created by AbstractClusterDissimilarity.createDistanceMatrix(jsat.DataSet, jsat.clustering.dissimilarity.ClusterDissimilarity)
        Returns:
        a value >= 0 that describes the dissimilarity of the union of two clusters with a third cluster. The larger the value, the more different the resulting clusterings are.
      • dissimilarity

        public double dissimilarity(int ni,
                                    int nj,
                                    int nk,
                                    double d_ij,
                                    double d_ik,
                                    double d_jk)
        Provides the notion of dissimilarity between two sets of points, that may not have the same number of points. This is done using a matrix containing all pairwise distance computations between all points. This distance matrix will then be updated at each iteration and merging, leaving empty space in the matrix. The updates will be done by the clustering algorithm. Implementing this interface indicates that this dissimilarity measure can be accurately computed in an updatable manner that is compatible with a Lance–Williams update.
        This computes the dissimilarity of the union of clusters i and j, (Ci ∪ Cj), with the cluster k. This method is used by other algorithms to perform an update of the distance matrix in an efficient manner.
        Parameters:
        ni - the number of items in the cluster represented by i
        nj - the number of items in the cluster represented by j
        nk - the number of items in the cluster represented by k
        d_ij - the distance between clusters i and j
        d_ik - the distance between clusters i and k
        d_jk - the distance between clusters j and k
        Returns:
        the distance between the cluster formed from i and j, to the cluster k

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.