summaryrefslogtreecommitdiff
path: root/src/python/gudhi/clustering
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2020-03-02 18:01:49 +0100
committerMarc Glisse <marc.glisse@inria.fr>2020-03-02 18:01:49 +0100
commitfa8c487b24b58797398ce3a93a95095b43de23f3 (patch)
treefb79e6a652940f1c22f45ecb028abba11374d56c /src/python/gudhi/clustering
parent1b1c621370ff887578d7aad8eb7e28ee9ec7812a (diff)
bugs from incomplete renaming
Diffstat (limited to 'src/python/gudhi/clustering')
-rw-r--r--src/python/gudhi/clustering/tomato.py10
1 files changed, 5 insertions, 5 deletions
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