Redistributor is a Python package which forces a collection of scalar samples to follow a desired distribution. When given independent and identically distributed samples of some random variable
pip install redistributor
from redistributor import Redistributor as R
from redistributor import LearnedDistribution as L
from scipy.stats import dgamma, norm
S = dgamma(7).rvs(size=1000) # Samples from source distribution
target = norm(0, 1) # In this example, target is set explicitly
r = R(source=L(S), target=target) # Estimate the transformation
output = r.transform(S) # Data now follows the target distribution
More in examples.ipynb
. Examples for image processing are in examples-images.ipynb
.
Documentation is available in docs
folder.
- 🔨 Package is still under development
- 2024.07 - Preprint on ArXiv updated with new results
- 2024.07 - Package released on PyPi.org 🎉
- 2024.07 - Repository mirrored to GitHub for easier access of the community
- 2023.10 - Added code examples of image processing
- 2022.10 - Preprint published on ArXiv 🎉
- 2022.09 - Redistributor v1.0 (complete rewrite)
- 2021.10 - Redistributor v0.2 (generalization to arbitrary source & target)
- 2018.08 - Introducing Redistributor (generalization to arbitrary target)
- 2018.07 - Introducing Gaussifier package (now deprecated)
If you use Redistributor in your research, please cite the following paper:
@article{harar2022redistributor,
title={Redistributor: Transforming Empirical Data Distributions},
author={Harar, P. and Elbrächter, D. and Dörfler, M. and Johnson, K.},
eprinttype={ArXiv},
eprint={2210.14219}
}
This project is licensed under the terms of the MIT license.
See license.txt
for details.