From 5f9a63e440a7ffdcd9fde689b6eb3b3a6b76b9bd Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Tue, 21 Apr 2020 15:24:41 +0200 Subject: Compute prominence, not its opposite... --- src/python/gudhi/clustering/tomato.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/python/gudhi/clustering') diff --git a/src/python/gudhi/clustering/tomato.py b/src/python/gudhi/clustering/tomato.py index 7b319b5c..f25dacd5 100644 --- a/src/python/gudhi/clustering/tomato.py +++ b/src/python/gudhi/clustering/tomato.py @@ -305,7 +305,7 @@ class Tomato: if self.__merge_threshold: assert not self.__n_clusters self.__n_clusters = numpy.count_nonzero( - self.diagram_[:, 1] - self.diagram_[:, 0] > self.__merge_threshold + self.diagram_[:, 0] - self.diagram_[:, 1] > self.__merge_threshold ) + len(self.max_density_per_cc_) if self.__n_clusters: renaming = merge(self.children_, self.n_leaves_, self.__n_clusters) @@ -364,7 +364,7 @@ class Tomato: if merge_threshold == self.__merge_threshold: return if hasattr(self, "leaf_labels_"): - self.n_clusters_ = numpy.count_nonzero(self.diagram_[:, 1] - self.diagram_[:, 0] > merge_threshold) + len( + self.n_clusters_ = numpy.count_nonzero(self.diagram_[:, 0] - self.diagram_[:, 1] > merge_threshold) + len( self.max_density_per_cc_ ) else: -- cgit v1.2.3