A lightweight JAX-based library offering a collection of distance and similarity measures for data analysis. Designed for scalability and accelerator support, it includes high-performance, parallelizable implementations of a wide range of commonly used metrics.
You have the choice to install the latest release via PyPI by running
pip install metrx
or you do an editable installation by cloning this repository and then running
pip install -e .
This library is still in development and more metrics will be added over time. The following metrics are currently implemented.
- Minkowski Distance
- Euclidean Distance
- Cosine Distance
- Mahalanobis Distance
- Dynamic Time Warping
- Discrete Frechet Distance
- Sinkhorn Distance
- Relative Entropy (Kullback-Leibler Divergence)
- Frechet Inception Distance
- Maximum Mean Discrepancy
- Wassersteim Distance
- Gromov-Wassersteim Distance
To test, there are two examples: Either compare batches of particles
python examples/example_particle_data.py
or batches of time series data
python examples/example_time_series_data.py
If you use this libarary in your work, please consider citing it as follows:
@software{metrx2024github,
author = {Pompetzki, Kay and Gruner, Theo and Al-Hafez, Firas, and Le, An T., and Peters, Jan},
title = {MetrX: A JAX-Based Collection of Similarity and Statistical Measures for Accelerated Data Analysis.},
url = {https://github.com/pompetzki/metrx},
year = {2024},
}