diff options
author | wreise <wojciech.reise@epfl.ch> | 2022-05-25 14:34:11 +0200 |
---|---|---|
committer | wreise <wojciech.reise@epfl.ch> | 2022-05-25 14:34:11 +0200 |
commit | 1a76ecc3e7459e3461e1f182004362dcb663addd (patch) | |
tree | 4e29a2e0a1c7815991ca5d10ca7fd49b52ce1103 /src/python/gudhi/representations/vector_methods.py | |
parent | 3aa89676d1dc2cafcc692480bbf424a97dbbd501 (diff) |
Compactify
Diffstat (limited to 'src/python/gudhi/representations/vector_methods.py')
-rw-r--r-- | src/python/gudhi/representations/vector_methods.py | 3 |
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)) |