From 6aa18ec3b382f045ba7b97c7cbd6462e1de892ef Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Mon, 9 Mar 2020 15:19:48 +0100 Subject: Make fit return self --- src/python/gudhi/clustering/tomato.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/python/gudhi/clustering/tomato.py b/src/python/gudhi/clustering/tomato.py index e3d814d1..000fdf3d 100644 --- a/src/python/gudhi/clustering/tomato.py +++ b/src/python/gudhi/clustering/tomato.py @@ -312,13 +312,13 @@ class Tomato: else: self.labels_ = self.leaf_labels_ self.__n_clusters = self.n_leaves_ + return self def fit_predict(self, X, y=None, weights=None): """ Equivalent to fit(), and returns the `labels_`. """ - self.fit(X, y, weights) - return self.labels_ + return self.fit(X, y, weights).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): -- cgit v1.2.3