From fa8c487b24b58797398ce3a93a95095b43de23f3 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Mon, 2 Mar 2020 18:01:49 +0100 Subject: bugs from incomplete renaming --- src/python/gudhi/clustering/tomato.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/python/gudhi/clustering/tomato.py') diff --git a/src/python/gudhi/clustering/tomato.py b/src/python/gudhi/clustering/tomato.py index 9cf4b231..0d754a62 100644 --- a/src/python/gudhi/clustering/tomato.py +++ b/src/python/gudhi/clustering/tomato.py @@ -76,7 +76,7 @@ class Tomato: self.params_ = params self.__n_clusters = n_clusters self.__merge_threshold = merge_threshold - self.eliminate_threshold_ = eliminate_threshold + #self.eliminate_threshold_ = eliminate_threshold if n_clusters and merge_threshold: raise ValueError("Cannot specify both a merge threshold and a number of clusters") @@ -295,13 +295,13 @@ class Tomato: self.neighbors_[j].add(i) self.weights_ = weights # TODO remove - self.leaf_labels_, self.children_, self.diagram_, self.max_density_per_cc_ = tomato.doit( + self.leaf_labels_, self.children_, self.diagram_, self.max_density_per_cc_ = doit( list(self.neighbors_), weights ) self.n_leaves_ = len(self.max_density_per_cc_) + len(self.children_) assert self.leaf_labels_.max() + 1 == len(self.max_density_per_cc_) + len(self.children_) if self.__n_clusters: - renaming = tomato.merge(self.children_, self.n_leaves_, self.__n_clusters) + renaming = merge(self.children_, self.n_leaves_, self.__n_clusters) self.labels_ = renaming[self.leaf_labels_] else: self.labels_ = self.leaf_labels_ @@ -311,7 +311,7 @@ class Tomato: """ """ self.fit(X) - return labels_ + return self.labels_ # TODO: add argument k or threshold? Have a version where you can click and it shows the line and the corresponding k? def plot_diagram(self): @@ -344,7 +344,7 @@ class Tomato: self.__n_clusters = n_clusters self.__merge_threshold = None if hasattr(self, "leaf_labels_"): - renaming = tomato.merge(self.children_, self.n_leaves_, self.__n_clusters) + renaming = merge(self.children_, self.n_leaves_, self.__n_clusters) self.labels_ = renaming[self.leaf_labels_] @property -- cgit v1.2.3