summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/python/gudhi/representations/vector_methods.py3
1 files changed, 1 insertions, 2 deletions
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))