Name | redistributor JSON |
Version |
1.0.0
JSON |
| download |
home_page | None |
Summary | A tool for automatic transformation of empirical data distributions |
upload_time | 2024-07-05 23:37:48 |
maintainer | None |
docs_url | None |
author | Pavol Harar |
requires_python | >3.6 |
license | MIT |
keywords |
distribution
transformation
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<img src="https://gitlab.com/paloha/redistributor/uploads/e1bbea08834112646af45e6917324379/avatar.png" alt="match_colors" width="20%">
# Redistributor
**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 $S$ and the continuous cumulative distribution function of some desired target $T$, it provably produces a consistent estimator of the transformation $R$ which satisfies $R(S)=T$ in distribution. As the distribution of $S$ or $T$ may be unknown, we also include algorithms for efficiently estimating these distributions from samples. This allows for various interesting use cases in image processing, where Redistributor serves as a remarkably simple and easy-to-use tool that is capable of producing visually appealing results. The package is implemented in Python and is optimized to efficiently handle large data sets, making it also suitable as a preprocessing step in machine learning.
<br>
<img src="https://gitlab.com/paloha/redistributor/uploads/ce5305668697d3bdf6035c839aceb2c2/match_colors.jpg" alt="Example of matching colors" width="100%">
<small><i><center>Matching colors of a reference image – one of the use cases of Redistributor</center></i></small>
## Installation
```bash
pip install redistributor
```
## Quick-start
```python
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
Documentation is available in `docs` folder.
## News & Changelog
* :hammer: Package is still under development
* 2024.07 - [Preprint](https://arxiv.org/abs/2210.14219) on ArXiv updated with new results
* 2024.07 - Package released on PyPi.org :tada:
* 2024.07 - Repository mirrored to GitHub for easier access of the community
* 2023.10 - Added code examples of image processing
* 2022.10 - [Preprint](https://arxiv.org/abs/2210.14219) published on ArXiv :tada:
* 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)
## How to cite
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}
}
```
## License
This project is licensed under the terms of the MIT license.
See `license.txt` for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "redistributor",
"maintainer": null,
"docs_url": null,
"requires_python": ">3.6",
"maintainer_email": null,
"keywords": "distribution transformation",
"author": "Pavol Harar",
"author_email": "pavol.harar@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/6e/29/5f9a46aa719c340a131b051e7ec9f0e7174162df1f644aeb0869aa5bdacc/redistributor-1.0.0.tar.gz",
"platform": "any",
"description": "\n<img src=\"https://gitlab.com/paloha/redistributor/uploads/e1bbea08834112646af45e6917324379/avatar.png\" alt=\"match_colors\" width=\"20%\">\n\n# Redistributor\n\n**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 $S$ and the continuous cumulative distribution function of some desired target $T$, it provably produces a consistent estimator of the transformation $R$ which satisfies $R(S)=T$ in distribution. As the distribution of $S$ or $T$ may be unknown, we also include algorithms for efficiently estimating these distributions from samples. This allows for various interesting use cases in image processing, where Redistributor serves as a remarkably simple and easy-to-use tool that is capable of producing visually appealing results. The package is implemented in Python and is optimized to efficiently handle large data sets, making it also suitable as a preprocessing step in machine learning.\n<br>\n\n<img src=\"https://gitlab.com/paloha/redistributor/uploads/ce5305668697d3bdf6035c839aceb2c2/match_colors.jpg\" alt=\"Example of matching colors\" width=\"100%\">\n<small><i><center>Matching colors of a reference image \u2013 one of the use cases of Redistributor</center></i></small>\n\n## Installation\n\n```bash\npip install redistributor\n```\n\n## Quick-start\n\n```python\nfrom redistributor import Redistributor as R\nfrom redistributor import LearnedDistribution as L\nfrom scipy.stats import dgamma, norm\n\nS = dgamma(7).rvs(size=1000) # Samples from source distribution\ntarget = norm(0, 1) # In this example, target is set explicitly\nr = R(source=L(S), target=target) # Estimate the transformation\noutput = r.transform(S) # Data now follows the target distribution\n```\nMore in `examples.ipynb`. Examples for image processing are in `examples-images.ipynb`.\n\n## Documentation\nDocumentation is available in `docs` folder.\n\n\n## News & Changelog\n\n* :hammer: Package is still under development\n* 2024.07 - [Preprint](https://arxiv.org/abs/2210.14219) on ArXiv updated with new results\n* 2024.07 - Package released on PyPi.org :tada:\n* 2024.07 - Repository mirrored to GitHub for easier access of the community\n* 2023.10 - Added code examples of image processing\n* 2022.10 - [Preprint](https://arxiv.org/abs/2210.14219) published on ArXiv :tada:\n* 2022.09 - Redistributor v1.0 (complete rewrite)\n* 2021.10 - Redistributor v0.2 (generalization to arbitrary source & target)\n* 2018.08 - Introducing Redistributor (generalization to arbitrary target)\n* 2018.07 - Introducing Gaussifier package (now deprecated)\n\n## How to cite\n\nIf you use Redistributor in your research, please cite the following paper:\n```\n@article{harar2022redistributor,\n title={Redistributor: Transforming Empirical Data Distributions},\n author={Harar, P. and Elbr\u00e4chter, D. and D\u00f6rfler, M. and Johnson, K.},\n eprinttype={ArXiv},\n eprint={2210.14219}\n}\n```\n\n## License\nThis project is licensed under the terms of the MIT license.\nSee `license.txt` for details.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A tool for automatic transformation of empirical data distributions",
"version": "1.0.0",
"project_urls": {
"Documentation": "https://github.com/paloha/redistributor/raw/master/docs/redistributor.pdf",
"Issue tracker": "https://github.com/paloha/redistributor/issues",
"Publication": "https://arxiv.org/abs/2210.14219",
"Source": "https://github.com/paloha/redistributor"
},
"split_keywords": [
"distribution",
"transformation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "46ff266a5d96f6b19fbbdad24751dab0047dfb785d753e3e6632f4382bb1d65e",
"md5": "de390284a1e251e0cd8bf75576bf3b18",
"sha256": "6a7fa82e018024c77148bc13b496c712c8434b133db4201eeaf03061568d130b"
},
"downloads": -1,
"filename": "redistributor-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "de390284a1e251e0cd8bf75576bf3b18",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">3.6",
"size": 13871,
"upload_time": "2024-07-05T23:37:46",
"upload_time_iso_8601": "2024-07-05T23:37:46.870467Z",
"url": "https://files.pythonhosted.org/packages/46/ff/266a5d96f6b19fbbdad24751dab0047dfb785d753e3e6632f4382bb1d65e/redistributor-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6e295f9a46aa719c340a131b051e7ec9f0e7174162df1f644aeb0869aa5bdacc",
"md5": "455d8e26d6fa6f3bcfdbf98ed2969cd4",
"sha256": "5b9422b0756744f99a4c00cc645b31b31fc621ef1b476be737b2d90e6f09075e"
},
"downloads": -1,
"filename": "redistributor-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "455d8e26d6fa6f3bcfdbf98ed2969cd4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">3.6",
"size": 14136,
"upload_time": "2024-07-05T23:37:48",
"upload_time_iso_8601": "2024-07-05T23:37:48.392994Z",
"url": "https://files.pythonhosted.org/packages/6e/29/5f9a46aa719c340a131b051e7ec9f0e7174162df1f644aeb0869aa5bdacc/redistributor-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-05 23:37:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "paloha",
"github_project": "redistributor",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "redistributor"
}