8000 GitHub - WenjieDu/PyGrinder at v0.2
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

PyGrinder: a Python toolkit for grinding data beans into the incomplete for real-world data simulation by introducing missing values with different missingness patterns, including MCAR (complete at random), MAR (at random), MNAR (not at random), sub sequence missing, and block missing

License

Notifications You must be signed in to change notification settings

WenjieDu/PyGrinder

Repository files navigation

Welcome to PyGrinder

a Python toolkit for grinding data beans into the incomplete

Python version the latest release version BSD-3 license GitHub Testing Code Climate maintainability Coveralls report Conda downloads PyPI downloads

PyGrinder is a part of PyPOTS project (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 ❗️

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

import numpy as np
import pygrinder

# 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_intact, X, missing_mask, indicating_mask = pygrinder.mcar(ts_dataset, p=0.1, nan=0)

# grind the dataset with MAR pattern
X_intact, X, missing_mask, indicating_mask = pygrinder.mar_logistic(ts_dataset[:, 0, :], obs_rate=0.1, missing_rate=0.1, nan=0)

# grind the dataset with MNAR pattern
X_intact, X, missing_mask, indicating_mask = pygrinder.mnar_x(ts_dataset, offset=0.1, nan=0)
X_intact, X, missing_mask, indicating_mask = pygrinder.mnar_t(ts_dataset, cycle=20, pos = 10, scale = 3, nan=0)

❖ Citing PyGrinder/PyPOTS

The paper introducing PyPOTS project is available on arXiv at this URL, and we are pursuing to publish it in prestigious academic venues, e.g. JMLR (track for Machine Learning Open Source Software). 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!

@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

@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

🏠 Visits

About

PyGrinder: a Python toolkit for grinding data beans into the incomplete for real-world data simulation by introducing missing values with different missingness patterns, including MCAR (complete at random), MAR (at random), MNAR (not at random), sub sequence missing, and block missing

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages

0