Metadata-Version: 2.1
Name: metrx
Version: 0.1.0
Summary: "A library containing a collection of distance and similarity measures to compare time series data."
Author-email: Kay Pompetzki <kay.hansel@tu-darmstadt.de>, Theo Gruner <theo_sunao.gruner@tu-darmstadt.de>, Firas Al-Hafez <fi.alhafez@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Kay Hansel
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/pompetzki/metrx
Project-URL: Repository, https://github.com/pompetzki/metrx
Project-URL: Issues, https://github.com/pompetzki/metrx/issues
Keywords: Distance Measures,Statistical Measures,jax
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: distrax>=0.1.5
Requires-Dist: flax>=0.8.1
Requires-Dist: jax>=0.4.25
Requires-Dist: optax>=0.1.7
Requires-Dist: ott-jax>=0.4.9
Requires-Dist: numpy
Requires-Dist: pytest

![metrx_logo](https://github.com/user-attachments/assets/32dc9c40-106b-476f-801b-4b9ae25b1433)

![continous integration](https://github.com/pompetzki/metrx/actions/workflows/continuous_integration.yml/badge.svg?branch=main)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)



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.

## Installation 
```bash
pip install -e .
```

## Implemented Metrics
This library is still in development and more metrics will be added over time.
The following metrics are currently implemented.
### Distance Measures
- [Minkowski Distance](https://github.com/pompetzki/metrx/blob/main/metrx/distance_measures.py#L171)
- [Euclidean Distance](https://github.com/pompetzki/metrx/blob/main/metrx/distance_measures.py#L277)
- [Cosine Distance](https://github.com/pompetzki/metrx/blob/main/metrx/distance_measures.py#L438)
- [Mahalanobis Distance](https://github.com/pompetzki/metrx/blob/main/metrx/distance_measures.py#L490)
- [Dynamic Time Warping](https://github.com/pompetzki/metrx/blob/main/metrx/distance_measures.py#L754)
- [Discrete Frechet Distance](https://github.com/pompetzki/metrx/blob/main/metrx/distance_measures.py#L897)
- [Sinkhorn Distance](https://github.com/pompetzki/metrx/blob/main/metrx/distance_measures.py#L1136)

### Statistical Measures
- [Relative Entropy (Kullback-Leibler Divergence)](https://github.com/pompetzki/metrx/blob/main/metrx/statistical_measures.py#L174)
- [Frechet Inception Distance](https://github.com/pompetzki/metrx/blob/main/metrx/statistical_measures.py#L295)
- [Maximum Mean Discrepancy](https://github.com/pompetzki/metrx/blob/main/metrx/statistical_measures.py#L425)
- [Wassersteim Distance](https://github.com/pompetzki/metrx/blob/main/metrx/statistical_measures.py#L605)


## Examples
To test, there are two examples:
Either compare batches of particles
```bash
python examples/example_particle_data.py
```
or batches of time series data
```bash
python examples/example_time_series_data.py
```
    
## Citation
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 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},
}
```
