0

Is there any python library for computing EMD between two signatures? There are multiple options to compute EMD between two distributions (e.g. pyemd). But I didn't find any implementation for the exact EMD value. For example, consider Signature_1 = {(1,1), (4,1)} and Signature_2 = {(1,1), (2,1), (3,1), (4,1)}, where first coordinate is the position and second coordinate is the weight. True EMD(Signature_1, Signature_2) = 0 whereas if we consider these as distributions then the distance is 0.5 (the emd_samples in pyemd gives this answer). But I would be interested in the implementation of True EMD. Any help in this regard would be appreciated.

Unknown
  • 53
  • 1
  • 5
  • How can you consider Signature_1, Signature_2 as distributions? Also what's with the sudden interest in this distance metric, I answered [a question](https://stackoverflow.com/questions/65175268/1d-wasserstein-distance-in-python/65175524#65175524) on how to compute this not even 2 hours ago. – orlp Dec 07 '20 at 04:13
  • Thanks for your reply. The mass of the signatures are normalized to make them a distribution. For more details please look at Section 2.2 of http://luthuli.cs.uiuc.edu/~daf/courses/Opt-2017/Combinatorialpapers/EMD.pdf . – Unknown Dec 07 '20 at 05:01

1 Answers1

0

No worries. I got the answer. You can just use "normalized" = False, "extra_mass_penalty" = 0 in the arguments of "emd_samples" function of pyemd.

Unknown
  • 53
  • 1
  • 5