pygrinder


Namepygrinder JSON
Version 0.4 PyPI version JSON
download
home_pagehttps://github.com/WenjieDu/PyGrinder
SummaryA Python toolkit for introducing missing values into datasets
upload_time2023-12-16 05:40:47
maintainer
docs_urlNone
authorWenjie Du
requires_python
licenseBSD-3-Clause
keywords data corruption incomplete data data mining pypots missingness partially observed irregular sampled partially-observed time series incomplete time series missing data missing values pypots
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <a href='https://github.com/WenjieDu/PyGrinder'><img src='https://pypots.com/figs/pypots_logos/PyGrinder_logo_FFBG.svg?sanitize=true' width='200' align='right' /></a>

<h2 align="center">Welcome to PyGrinder</h2>

*<p align='center'>a Python toolkit for grinding data beans into the incomplete</p>*

<p align='center'>
    <a href='https://github.com/WenjieDu/PyGrinder'>
        <img alt='Python version' src='https://img.shields.io/badge/python-v3-E97040?logo=python&logoColor=white'>
    </a>
    <a href="https://github.com/WenjieDu/PyGrinder/releases">
        <img alt="the latest release version" src="https://img.shields.io/github/v/release/wenjiedu/PyGrinder?color=EE781F&include_prereleases&label=Release&logo=github&logoColor=white">
    </a>
    <a href="https://github.com/WenjieDu/PyGrinder/blob/main/LICENSE">
        <img alt="BSD-3 license" src="https://img.shields.io/badge/License-BSD--3-E9BB41?logo=opensourceinitiative&logoColor=white">
    </a>
    <a href="https://github.com/WenjieDu/PyPOTS/blob/main/README.md#-community">
        <img alt="Community" src="https://img.shields.io/badge/join_us-community!-C8A062">
    </a>
    <a href="https://github.com/WenjieDu/PyGrinder/graphs/contributors">
        <img alt="GitHub contributors" src="https://img.shields.io/github/contributors/wenjiedu/pygrinder?color=D8E699&label=Contributors&logo=GitHub">
    </a>
    <a href="https://star-history.com/#wenjiedu/pygrinder">
        <img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/wenjiedu/pygrinder?logo=Github&color=6BB392&label=Stars">
    </a>
    <a href="https://github.com/WenjieDu/PyGrinder/network/members">
        <img alt="GitHub Repo forks" src="https://img.shields.io/github/forks/wenjiedu/pygrinder?logo=Github&color=91B821&label=Forks">
    </a>
    <a href="https://codeclimate.com/github/WenjieDu/PyGrinder">
        <img alt="Code Climate maintainability" src="https://img.shields.io/codeclimate/maintainability-percentage/WenjieDu/PyGrinder?color=3C7699&label=Maintainability&logo=codeclimate">
    </a>
    <a href='https://coveralls.io/github/WenjieDu/PyGrinder'>
        <img alt='Coveralls report' src='https://img.shields.io/coverallsCoverage/github/WenjieDu/PyGrinder?branch=main&logo=coveralls&color=75C1C4&label=Coverage'>
    </a>
    <a  href='https://github.com/WenjieDu/PyGrinder/actions/workflows/testing_ci.yml'>
        <img alt='GitHub Testing' src='https://img.shields.io/github/actions/workflow/status/wenjiedu/PyGrinder/testing_ci.yml?logo=github&color=C8D8E1&label=CI'>
    </a>
    <a href="https://arxiv.org/abs/2305.18811">
        <img alt="arXiv DOI" src="https://img.shields.io/badge/DOI-10.48550/arXiv.2305.18811-F8F7F0">
    </a>
    <a href="https://anaconda.org/conda-forge/PyGrinder">
        <img alt="Conda downloads" src="https://img.shields.io/endpoint?url=https://pypots.com/figs/downloads_badges/conda_pygrinder_downloads.json">
    </a>
    <a href='https://pepy.tech/project/PyGrinder'>
        <img alt='PyPI downloads' src='https://img.shields.io/endpoint?url=https://pypots.com/figs/downloads_badges/pypi_pygrinder_downloads.json'>
    </a>
</p>

<a href='https://github.com/WenjieDu/PyPOTS'><img src='https://pypots.com/figs/pypots_logos/PyPOTS_logo_FFBG.svg?sanitize=true' width='160' align='left' /></a>
PyGrinder is a part of
<a href="https://github.com/WenjieDu/PyPOTS">
PyPOTS <img align="center" src="https://img.shields.io/github/stars/WenjieDu/PyPOTS?style=social">
</a>
(a Python toolbox for data mining on
Partially-Observed Time Series), was called PyCorruptor and separated from PyPOTS for decoupling missingness-creating functionalities from
learning algorithms.

In data analysis and modeling, sometimes we may need to corrupt the original data to achieve our goal, for instance,
evaluating models' ability to reconstruct corrupted data or assessing the model's performance on only partially-observed
data. PyGrinder is such a tool to help you corrupt your data, which provides several patterns to create missing values
in the given data.


## ❖ Usage Examples
PyGrinder now is available on <a alt='Anaconda' href='https://anaconda.org/conda-forge/tsdb'><img align='center' src='https://img.shields.io/badge/Anaconda--lightgreen?style=social&logo=anaconda'></a>❗️

Install it with `conda install pygrinder`, you may need to specify the channel with option `-c conda-forge`

or install from PyPI:
> pip install pygrinder

or install from source code:
> pip install `https://github.com/WenjieDu/PyGrinder/archive/main.zip`

```python
import numpy as np
from pygrinder import mcar, mar_logistic, mnar_x, mnar_t

# given a time-series dataset with 128 samples, each sample with 10 time steps and 36 data features
ts_dataset = np.random.randn(128, 10, 36)

# grind the dataset with MCAR pattern, 10% missing probability, and using 0 to fill missing values
X_with_mcar_data = mcar(ts_dataset, p=0.1)

# grind the dataset with MAR pattern
X_with_mar_data = mar_logistic(ts_dataset[:, 0, :], obs_rate=0.1, missing_rate=0.1)

# grind the dataset with MNAR pattern
X_with_mnar_x_data = mnar_x(ts_dataset, offset=0.1)
X_with_mnar_t_data = mnar_t(ts_dataset, cycle=20, pos = 10, scale = 3)
```


## ❖ Citing PyGrinder/PyPOTS

The paper introducing PyPOTS project is available on arXiv at [this URL](https://arxiv.org/abs/2305.18811),
and we are pursuing to publish it in prestigious academic venues, e.g. JMLR (track for
[Machine Learning Open Source Software](https://www.jmlr.org/mloss/)). If you use PyGrinder in your work,
please cite PyPOTS project as below and 🌟star this repository to make others notice this library. πŸ€— Thank you!


``` bibtex
@article{du2023PyPOTS,
title={{PyPOTS: a Python toolbox for data mining on Partially-Observed Time Series}},
author={Wenjie Du},
year={2023},
eprint={2305.18811},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2305.18811},
doi={10.48550/arXiv.2305.18811},
}
```

> Wenjie Du. (2023).
> PyPOTS: a Python toolbox for data mining on Partially-Observed Time Series.
> arXiv, abs/2305.18811.https://arxiv.org/abs/2305.18811

or

``` bibtex
@inproceedings{du2023PyPOTS,
title={{PyPOTS: a Python toolbox for data mining on Partially-Observed Time Series}},
booktitle={9th SIGKDD workshop on Mining and Learning from Time Series (MiLeTS'23)},
author={Wenjie Du},
year={2023},
url={https://arxiv.org/abs/2305.18811},
}
```

> Wenjie Du. (2023).
> PyPOTS: a Python toolbox for data mining on Partially-Observed Time Series.
> In *9th SIGKDD workshop on Mining and Learning from Time Series (MiLeTS'23)*. https://arxiv.org/abs/2305.18811


<details>
<summary>🏠 Visits</summary>
<img align='left' src='https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FWenjieDu%2FPyCorruptor&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=Visits+since+May+2022&edge_flat=false'>
</details>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/WenjieDu/PyGrinder",
    "name": "pygrinder",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "data corruption,incomplete data,data mining,pypots,missingness,partially observed,irregular sampled,partially-observed time series,incomplete time series,missing data,missing values,pypots",
    "author": "Wenjie Du",
    "author_email": "wenjay.du@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/fd/ee/f447888de3424bb71b4aa77e078fc13551905d403e66d1f17ad2a5cb1280/pygrinder-0.4.tar.gz",
    "platform": null,
    "description": "<a href='https://github.com/WenjieDu/PyGrinder'><img src='https://pypots.com/figs/pypots_logos/PyGrinder_logo_FFBG.svg?sanitize=true' width='200' align='right' /></a>\n\n<h2 align=\"center\">Welcome to PyGrinder</h2>\n\n*<p align='center'>a Python toolkit for grinding data beans into the incomplete</p>*\n\n<p align='center'>\n    <a href='https://github.com/WenjieDu/PyGrinder'>\n        <img alt='Python version' src='https://img.shields.io/badge/python-v3-E97040?logo=python&logoColor=white'>\n    </a>\n    <a href=\"https://github.com/WenjieDu/PyGrinder/releases\">\n        <img alt=\"the latest release version\" src=\"https://img.shields.io/github/v/release/wenjiedu/PyGrinder?color=EE781F&include_prereleases&label=Release&logo=github&logoColor=white\">\n    </a>\n    <a href=\"https://github.com/WenjieDu/PyGrinder/blob/main/LICENSE\">\n        <img alt=\"BSD-3 license\" src=\"https://img.shields.io/badge/License-BSD--3-E9BB41?logo=opensourceinitiative&logoColor=white\">\n    </a>\n    <a href=\"https://github.com/WenjieDu/PyPOTS/blob/main/README.md#-community\">\n        <img alt=\"Community\" src=\"https://img.shields.io/badge/join_us-community!-C8A062\">\n    </a>\n    <a href=\"https://github.com/WenjieDu/PyGrinder/graphs/contributors\">\n        <img alt=\"GitHub contributors\" src=\"https://img.shields.io/github/contributors/wenjiedu/pygrinder?color=D8E699&label=Contributors&logo=GitHub\">\n    </a>\n    <a href=\"https://star-history.com/#wenjiedu/pygrinder\">\n        <img alt=\"GitHub Repo stars\" src=\"https://img.shields.io/github/stars/wenjiedu/pygrinder?logo=Github&color=6BB392&label=Stars\">\n    </a>\n    <a href=\"https://github.com/WenjieDu/PyGrinder/network/members\">\n        <img alt=\"GitHub Repo forks\" src=\"https://img.shields.io/github/forks/wenjiedu/pygrinder?logo=Github&color=91B821&label=Forks\">\n    </a>\n    <a href=\"https://codeclimate.com/github/WenjieDu/PyGrinder\">\n        <img alt=\"Code Climate maintainability\" src=\"https://img.shields.io/codeclimate/maintainability-percentage/WenjieDu/PyGrinder?color=3C7699&label=Maintainability&logo=codeclimate\">\n    </a>\n    <a href='https://coveralls.io/github/WenjieDu/PyGrinder'>\n        <img alt='Coveralls report' src='https://img.shields.io/coverallsCoverage/github/WenjieDu/PyGrinder?branch=main&logo=coveralls&color=75C1C4&label=Coverage'>\n    </a>\n    <a  href='https://github.com/WenjieDu/PyGrinder/actions/workflows/testing_ci.yml'>\n        <img alt='GitHub Testing' src='https://img.shields.io/github/actions/workflow/status/wenjiedu/PyGrinder/testing_ci.yml?logo=github&color=C8D8E1&label=CI'>\n    </a>\n    <a href=\"https://arxiv.org/abs/2305.18811\">\n        <img alt=\"arXiv DOI\" src=\"https://img.shields.io/badge/DOI-10.48550/arXiv.2305.18811-F8F7F0\">\n    </a>\n    <a href=\"https://anaconda.org/conda-forge/PyGrinder\">\n        <img alt=\"Conda downloads\" src=\"https://img.shields.io/endpoint?url=https://pypots.com/figs/downloads_badges/conda_pygrinder_downloads.json\">\n    </a>\n    <a href='https://pepy.tech/project/PyGrinder'>\n        <img alt='PyPI downloads' src='https://img.shields.io/endpoint?url=https://pypots.com/figs/downloads_badges/pypi_pygrinder_downloads.json'>\n    </a>\n</p>\n\n<a href='https://github.com/WenjieDu/PyPOTS'><img src='https://pypots.com/figs/pypots_logos/PyPOTS_logo_FFBG.svg?sanitize=true' width='160' align='left' /></a>\nPyGrinder is a part of\n<a href=\"https://github.com/WenjieDu/PyPOTS\">\nPyPOTS <img align=\"center\" src=\"https://img.shields.io/github/stars/WenjieDu/PyPOTS?style=social\">\n</a>\n(a Python toolbox for data mining on\nPartially-Observed Time Series), was called PyCorruptor and separated from PyPOTS for decoupling missingness-creating functionalities from\nlearning algorithms.\n\nIn data analysis and modeling, sometimes we may need to corrupt the original data to achieve our goal, for instance,\nevaluating models' ability to reconstruct corrupted data or assessing the model's performance on only partially-observed\ndata. PyGrinder is such a tool to help you corrupt your data, which provides several patterns to create missing values\nin the given data.\n\n\n## \u2756 Usage Examples\nPyGrinder now is available on <a alt='Anaconda' href='https://anaconda.org/conda-forge/tsdb'><img align='center' src='https://img.shields.io/badge/Anaconda--lightgreen?style=social&logo=anaconda'></a>\u2757\ufe0f\n\nInstall it with `conda install pygrinder`, you may need to specify the channel with option `-c conda-forge`\n\nor install from PyPI:\n> pip install pygrinder\n\nor install from source code:\n> pip install `https://github.com/WenjieDu/PyGrinder/archive/main.zip`\n\n```python\nimport numpy as np\nfrom pygrinder import mcar, mar_logistic, mnar_x, mnar_t\n\n# given a time-series dataset with 128 samples, each sample with 10 time steps and 36 data features\nts_dataset = np.random.randn(128, 10, 36)\n\n# grind the dataset with MCAR pattern, 10% missing probability, and using 0 to fill missing values\nX_with_mcar_data = mcar(ts_dataset, p=0.1)\n\n# grind the dataset with MAR pattern\nX_with_mar_data = mar_logistic(ts_dataset[:, 0, :], obs_rate=0.1, missing_rate=0.1)\n\n# grind the dataset with MNAR pattern\nX_with_mnar_x_data = mnar_x(ts_dataset, offset=0.1)\nX_with_mnar_t_data = mnar_t(ts_dataset, cycle=20, pos = 10, scale = 3)\n```\n\n\n## \u2756 Citing PyGrinder/PyPOTS\n\nThe paper introducing PyPOTS project is available on arXiv at [this URL](https://arxiv.org/abs/2305.18811),\nand we are pursuing to publish it in prestigious academic venues, e.g. JMLR (track for\n[Machine Learning Open Source Software](https://www.jmlr.org/mloss/)). If you use PyGrinder in your work,\nplease cite PyPOTS project as below and \ud83c\udf1fstar this repository to make others notice this library. \ud83e\udd17 Thank you!\n\n\n``` bibtex\n@article{du2023PyPOTS,\ntitle={{PyPOTS: a Python toolbox for data mining on Partially-Observed Time Series}},\nauthor={Wenjie Du},\nyear={2023},\neprint={2305.18811},\narchivePrefix={arXiv},\nprimaryClass={cs.LG},\nurl={https://arxiv.org/abs/2305.18811},\ndoi={10.48550/arXiv.2305.18811},\n}\n```\n\n> Wenjie Du. (2023).\n> PyPOTS: a Python toolbox for data mining on Partially-Observed Time Series.\n> arXiv, abs/2305.18811.https://arxiv.org/abs/2305.18811\n\nor\n\n``` bibtex\n@inproceedings{du2023PyPOTS,\ntitle={{PyPOTS: a Python toolbox for data mining on Partially-Observed Time Series}},\nbooktitle={9th SIGKDD workshop on Mining and Learning from Time Series (MiLeTS'23)},\nauthor={Wenjie Du},\nyear={2023},\nurl={https://arxiv.org/abs/2305.18811},\n}\n```\n\n> Wenjie Du. (2023).\n> PyPOTS: a Python toolbox for data mining on Partially-Observed Time Series.\n> In *9th SIGKDD workshop on Mining and Learning from Time Series (MiLeTS'23)*. https://arxiv.org/abs/2305.18811\n\n\n<details>\n<summary>\ud83c\udfe0 Visits</summary>\n<img align='left' src='https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FWenjieDu%2FPyCorruptor&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=Visits+since+May+2022&edge_flat=false'>\n</details>\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "A Python toolkit for introducing missing values into datasets",
    "version": "0.4",
    "project_urls": {
        "Download": "https://github.com/WenjieDu/PyGrinder/archive/main.zip",
        "Homepage": "https://github.com/WenjieDu/PyGrinder"
    },
    "split_keywords": [
        "data corruption",
        "incomplete data",
        "data mining",
        "pypots",
        "missingness",
        "partially observed",
        "irregular sampled",
        "partially-observed time series",
        "incomplete time series",
        "missing data",
        "missing values",
        "pypots"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0584ff67fa5f679497dfc1d17cac1ff90d5df7de2bb4da80d0dcebb3c5f099b9",
                "md5": "1160fc3d4b346fc01f4b7b3338194237",
                "sha256": "580ffaddb7b8cd1a460ca3aebb99fa8beb403151dd10662123d46b98aec17481"
            },
            "downloads": -1,
            "filename": "pygrinder-0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1160fc3d4b346fc01f4b7b3338194237",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 14814,
            "upload_time": "2023-12-16T05:40:45",
            "upload_time_iso_8601": "2023-12-16T05:40:45.856829Z",
            "url": "https://files.pythonhosted.org/packages/05/84/ff67fa5f679497dfc1d17cac1ff90d5df7de2bb4da80d0dcebb3c5f099b9/pygrinder-0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fdeef447888de3424bb71b4aa77e078fc13551905d403e66d1f17ad2a5cb1280",
                "md5": "34cf4bfaf054f5c5e85a26501b7a8bbe",
                "sha256": "97e671dba28005dc62c735685a238c5b5a8f3af8b4741f0d18dab0d710243eaa"
            },
            "downloads": -1,
            "filename": "pygrinder-0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "34cf4bfaf054f5c5e85a26501b7a8bbe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13173,
            "upload_time": "2023-12-16T05:40:47",
            "upload_time_iso_8601": "2023-12-16T05:40:47.626733Z",
            "url": "https://files.pythonhosted.org/packages/fd/ee/f447888de3424bb71b4aa77e078fc13551905d403e66d1f17ad2a5cb1280/pygrinder-0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-16 05:40:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "WenjieDu",
    "github_project": "PyGrinder",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pygrinder"
}
        
Elapsed time: 0.15316s