From 1a76ecc3e7459e3461e1f182004362dcb663addd Mon Sep 17 00:00:00 2001 From: wreise Date: Wed, 25 May 2022 14:34:11 +0200 Subject: Compactify --- src/python/gudhi/representations/vector_methods.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/python/gudhi/representations') diff --git a/src/python/gudhi/representations/vector_methods.py b/src/python/gudhi/representations/vector_methods.py index 62b35389..e6289a37 100644 --- a/src/python/gudhi/representations/vector_methods.py +++ b/src/python/gudhi/representations/vector_methods.py @@ -267,8 +267,7 @@ class Silhouette(BaseEstimator, TransformerMixin): weights = np.array([self.weight(point) for point in diag]) total_weight = np.sum(weights) - tent_functions = heights[None, :] - np.abs(x_values[:, None] - midpoints[None, :]) - tent_functions[tent_functions < 0.] = 0. + tent_functions = np.maximum(heights[None, :] - np.abs(x_values[:, None] - midpoints[None, :]), 0) silhouette = np.sum(weights[None, :]/total_weight * tent_functions, axis=1) Xfit.append(silhouette * np.sqrt(2)) -- cgit v1.2.3