persim.wasserstein_matching

persim.wasserstein_matching(dgm1, dgm2, matching, labels=['dgm1', 'dgm2'], ax=None)[source]

Visualize bottleneck matching between two diagrams

Parameters:
  • dgm1 (array) – A diagram

  • dgm2 (array) – A diagram

  • matching (ndarray(Mx+Nx, 3)) – A list of correspondences in an optimal matching, as well as their distance, where: * First column is index of point in first persistence diagram, or -1 if diagonal * Second column is index of point in second persistence diagram, or -1 if diagonal * Third column is the distance of each matching

  • labels (list of strings) – names of diagrams for legend. Default = [“dgm1”, “dgm2”],

  • ax (matplotlib Axis object) – For plotting on a particular axis.

Examples

bn_matching, (matchidx, D) = persim.wasserstien(A_h1, B_h1, matching=True) persim.wasserstein_matching(A_h1, B_h1, matchidx, D)