コード例 #1
0
 def get_centroid_distance(self, cluster):
     """ Calculates the centroid-linkage distance between this and another
     cluster.
     """
     return mam_distances(self._tracks[self.centroid],
                          cluster._tracks[cluster.centroid],
                          self.z_thr, metric="max")
コード例 #2
0
 def get_centroid_distance(self, cluster):
     """ Calculates the centroid-linkage distance between this and another
     cluster.
     """
     return mam_distances(self._tracks[self.centroid],
                          cluster._tracks[cluster.centroid],
                          self.z_thr,
                          metric="max")
コード例 #3
0
 def get_complete_lnk_distance(self, cluster):
     """ Calculates the complete-linkage distance between this and another
     cluster.
     """
     max_distance = float("-inf")
     for Q in self._tracks:
         for R in cluster._tracks:
             distance = mam_distances(Q, R, self.z_thr, metric="max")
             if distance > max_distance: max_distance = distance
     return max_distance
コード例 #4
0
 def get_single_lnk_distance(self, cluster):
     """ Calculates the single-linkage distance between this and another
     cluster.
     """
     min_distance = float("inf")
     for Q in self._tracks:
         for R in cluster._tracks:
             distance = mam_distances(Q, R, self.z_thr, metric="max")
             if distance < min_distance: min_distance = distance
     return min_distance
コード例 #5
0
 def get_complete_lnk_distance(self, cluster):
     """ Calculates the complete-linkage distance between this and another
     cluster.
     """
     max_distance = float("-inf")
     for Q in self._tracks:
         for R in cluster._tracks:
             distance = mam_distances(Q, R, self.z_thr, metric="max")
             if distance > max_distance: max_distance = distance
     return max_distance
コード例 #6
0
 def get_single_lnk_distance(self, cluster):
     """ Calculates the single-linkage distance between this and another
     cluster.
     """
     min_distance = float("inf")
     for Q in self._tracks:
         for R in cluster._tracks:
             distance = mam_distances(Q, R, self.z_thr, metric="max")
             if distance < min_distance: min_distance = distance
     return min_distance