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

wasserstein calculate #183

Open
Li-shiyue opened this issue Oct 8, 2023 · 1 comment
Open

wasserstein calculate #183

Li-shiyue opened this issue Oct 8, 2023 · 1 comment

Comments

@Li-shiyue
Copy link

Hello,how can I calculate wasserstein distance if I only get two histogram.
I notice DiscreteNonParametric however it needs true probability vector whicih needs sum to 1
how can I calculate the distance instead the constraint?

@zsteve
Copy link
Member

zsteve commented Oct 10, 2023

Hi @Li-shiyue,

however it needs true probability vector whicih needs sum to 1

The Wasserstein distance requires that both inputs have the same sum. In the setting of DiscreteNonParametric, they sum to 1. If you have count data, transforming from counts to frequencies would give you probability vectors that sum to 1.
Could you provide some example code or inputs? Would help clarify this

Stephen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants