From 4a558f9542283533d1218a35ce43751615ca2ffd Mon Sep 17 00:00:00 2001 From: martinroyer <16647869+martinroyer@users.noreply.github.com> Date: Fri, 19 Jun 2020 14:29:55 +0200 Subject: fix for null inertias --- src/python/gudhi/representations/vector_methods.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/python/gudhi') diff --git a/src/python/gudhi/representations/vector_methods.py b/src/python/gudhi/representations/vector_methods.py index 566c24a3..aaf7ffeb 100644 --- a/src/python/gudhi/representations/vector_methods.py +++ b/src/python/gudhi/representations/vector_methods.py @@ -678,7 +678,7 @@ class Atol(BaseEstimator, TransformerMixin): self.inertias = np.array([np.max(dist_centers)/2]) else: dist_centers = pairwise.pairwise_distances(self.centers) - np.fill_diagonal(dist_centers, np.inf) + dist_centers[dist_centers == 0] = np.inf self.inertias = np.min(dist_centers, axis=0)/2 return self -- cgit v1.2.3