A simple Rust library for computing the Earth Mover's Distance (or "Wasserstein distance" or "Kantorovich–Rubinstein distance").
This is a wrapper of Gary Doran's pyemd.
Include the following in Cargo.toml
:
emd = "0.1.1"
Then:
extern crate emd;
#[macro_use(array)]
extern crate ndarray;
use emd::*;
use ndarray::*;
let x = array![0., 1.];
let y = array![5., 3.];
assert_eq!(distance(&x.view(), &y.view()), 3.5);
Check out the docs for more.