Skip to content

Commit

Permalink
fix inf points in atol fitting
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin ROYER authored and Martin ROYER committed Sep 18, 2023
1 parent 9978b84 commit 3dab4f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/python/gudhi/representations/vector_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,10 @@ def fit(self, X, y=None, sample_weight=None):
"""
if not hasattr(self.quantiser, 'fit'):
raise TypeError("quantiser %s has no `fit` attribute." % (self.quantiser))

# In fitting we remove infinite death time points so that every center is finite
X = [dgm[~np.isinf(dgm).any(axis=1), :] for dgm in X]

if sample_weight is None:
sample_weight = [self.get_weighting_method()(measure) for measure in X]

Expand Down

0 comments on commit 3dab4f8

Please sign in to comment.