Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PairwiseDistance with bottleneck metric returns non-symmetric matrix when delta is not zero #397

Closed
miltminz opened this issue Apr 14, 2020 · 0 comments · Fixed by #525
Closed
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@miltminz
Copy link

Test code:

from sklearn.datasets import load_digits
from gtda.homology import CubicalPersistence
from gtda.diagrams import PairwiseDistance

X, _ = load_digits(return_X_y=True) 
nb_samples = 100
CP = CubicalPersistence(homology_dimensions=(0, 1))
X_diag = CP.fit_transform(X[:nb_samples].reshape(nb_samples, 8, 8))
PD = PairwiseDistance(
    metric='bottleneck', metric_params={'delta': 0.01}, order=None)
X_distance = PD.fit_transform(X_diag)

The output returns, for example, X_distance[:, :, 0] which is not symmetric. As noticed by @ulupo in this discussion, the computation of the bottleneck distance is made by Hera and when delta is not zero the calculations are approximate and symmetry is not guaranteed.

The documentation of PairwiseDistance should include this explanation.

@ulupo ulupo self-assigned this Apr 14, 2020
@ulupo ulupo added good first issue Good for newcomers enhancement New feature or request labels Apr 14, 2020
@ulupo ulupo closed this as completed in #525 Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants