# adversarial-validation
[![PyPI](https://img.shields.io/pypi/v/advertion?color=blue&label=PyPI&logo=PyPI&logoColor=white)](https://pypi.org/project/advertion/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/advertion?logo=python&logoColor=white)](https://www.python.org/)
[![codecov](https://codecov.io/gh/ilias-ant/adversarial-validation/branch/main/graph/badge.svg?token=WXJ66ACKTA)](https://codecov.io/gh/ilias-ant/adversarial-validation)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/ilias-ant/adversarial-validation/ci.yml?branch=main)](https://github.com/ilias-ant/adversarial-validation/actions/workflows/ci.yml)
[![Documentation Status](https://readthedocs.org/projects/advertion/badge/?version=latest)](https://advertion.readthedocs.io/en/latest/?badge=latest)
[![PyPI - Wheel](https://img.shields.io/pypi/wheel/advertion?color=orange)](https://www.python.org/dev/peps/pep-0427/)
A tiny framework to perform adversarial validation of your training and test data.
<img src="https://raw.githubusercontent.com/ilias-ant/adversarial-validation/main/static/logo.png" width="95%" text="figjam">
**What is adversarial validation?**
A common workflow in machine learning projects (especially in Kaggle competitions) is:
1. train your ML model in a training dataset.
2. tune and validate your ML model in a validation dataset (typically is a discrete fraction of the training dataset).
3. finally, assess the actual generalization ability of your ML model in a “held-out” test dataset.
This strategy is widely accepted, but it heavily relies on the assumption that the training and test datasets are drawn
from the same underlying distribution. This is often referred to as the “*identically distributed*” property in the
literature.
This package helps you easily assert whether the "*identically distributed*" property holds true for your training and
test datasets or equivalently whether your validation dataset is a good proxy for your model's performance on the unseen
test instances.
If you are a person of details, feel free to take a deep dive to the following companion article:
[adversarial validation: can i trust my validation dataset?](https://ilias-ant.github.io/blog/adversarial-validation/)
## Install
The recommended installation is via `pip`:
```bash
pip install advertion
```
(*advertion stands for **adver**sarial valida**tion***)
## Usage
```python
from advertion import validate
train = pd.read_csv("...")
test = pd.read_csv("...")
validate(
trainset=train,
testset=test,
target="label",
)
# // {
# // "datasets_follow_same_distribution": True,
# // 'mean_roc_auc': 0.5021320833333334,
# // "adversarial_features': ['id'],
# // }
```
## How to contribute
If you wish to contribute, [this](CONTRIBUTING.md) is a great place to start!
## License
Distributed under the [Apache License 2.0](LICENSE).
Raw data
{
"_id": null,
"home_page": "https://pypi.org/project/advertion",
"name": "advertion",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.12,>=3.8.6",
"maintainer_email": null,
"keywords": "adversarial-validation, data-drift, machine-learning",
"author": "Ilias Antonopoulos",
"author_email": "ilias.antonopoulos@yahoo.gr",
"download_url": "https://files.pythonhosted.org/packages/1f/22/090a98355115397059e44fd69f18d0c44ece71fa89f6a6677cc03a390b0b/advertion-1.0.0.tar.gz",
"platform": null,
"description": "# adversarial-validation\n\n[![PyPI](https://img.shields.io/pypi/v/advertion?color=blue&label=PyPI&logo=PyPI&logoColor=white)](https://pypi.org/project/advertion/) \n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/advertion?logo=python&logoColor=white)](https://www.python.org/)\n[![codecov](https://codecov.io/gh/ilias-ant/adversarial-validation/branch/main/graph/badge.svg?token=WXJ66ACKTA)](https://codecov.io/gh/ilias-ant/adversarial-validation)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) \n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/ilias-ant/adversarial-validation/ci.yml?branch=main)](https://github.com/ilias-ant/adversarial-validation/actions/workflows/ci.yml)\n[![Documentation Status](https://readthedocs.org/projects/advertion/badge/?version=latest)](https://advertion.readthedocs.io/en/latest/?badge=latest)\n[![PyPI - Wheel](https://img.shields.io/pypi/wheel/advertion?color=orange)](https://www.python.org/dev/peps/pep-0427/)\n\nA tiny framework to perform adversarial validation of your training and test data.\n\n<img src=\"https://raw.githubusercontent.com/ilias-ant/adversarial-validation/main/static/logo.png\" width=\"95%\" text=\"figjam\">\n\n**What is adversarial validation?**\nA common workflow in machine learning projects (especially in Kaggle competitions) is:\n\n1. train your ML model in a training dataset.\n2. tune and validate your ML model in a validation dataset (typically is a discrete fraction of the training dataset).\n3. finally, assess the actual generalization ability of your ML model in a \u201cheld-out\u201d test dataset.\n\nThis strategy is widely accepted, but it heavily relies on the assumption that the training and test datasets are drawn \nfrom the same underlying distribution. This is often referred to as the \u201c*identically distributed*\u201d property in the \nliterature.\n\nThis package helps you easily assert whether the \"*identically distributed*\" property holds true for your training and \ntest datasets or equivalently whether your validation dataset is a good proxy for your model's performance on the unseen \ntest instances.\n\nIf you are a person of details, feel free to take a deep dive to the following companion article:\n\n[adversarial validation: can i trust my validation dataset?](https://ilias-ant.github.io/blog/adversarial-validation/)\n\n## Install\n\nThe recommended installation is via `pip`:\n\n```bash\npip install advertion\n```\n\n(*advertion stands for **adver**sarial valida**tion***)\n\n## Usage\n\n```python\nfrom advertion import validate\n\ntrain = pd.read_csv(\"...\")\ntest = pd.read_csv(\"...\")\n\nvalidate(\n trainset=train,\n testset=test,\n target=\"label\",\n)\n\n# // {\n# // \"datasets_follow_same_distribution\": True,\n# // 'mean_roc_auc': 0.5021320833333334,\n# // \"adversarial_features': ['id'],\n# // }\n```\n\n## How to contribute\n\nIf you wish to contribute, [this](CONTRIBUTING.md) is a great place to start!\n\n## License\n\nDistributed under the [Apache License 2.0](LICENSE).\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A tiny framework to perform adversarial validation of your training and test data.",
"version": "1.0.0",
"project_urls": {
"Bug Tracker": "https://github.com/ilias-ant/adversarial-validation/issues",
"Homepage": "https://pypi.org/project/advertion",
"Repository": "https://github.com/ilias-ant/adversarial-validation"
},
"split_keywords": [
"adversarial-validation",
" data-drift",
" machine-learning"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6ffd3af54bc2d2aa3a3159e3bd4ae022ca5fdcd655dec16212c03bdfcf5c1c2e",
"md5": "1998c75de7079ee771d3c85ba8b0be69",
"sha256": "f23005e7846f1f7de1ff4b15ed06f4b8df5f7aa7ed3d72a871504a89e2e6643e"
},
"downloads": -1,
"filename": "advertion-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1998c75de7079ee771d3c85ba8b0be69",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.12,>=3.8.6",
"size": 6361,
"upload_time": "2024-12-12T10:26:06",
"upload_time_iso_8601": "2024-12-12T10:26:06.002858Z",
"url": "https://files.pythonhosted.org/packages/6f/fd/3af54bc2d2aa3a3159e3bd4ae022ca5fdcd655dec16212c03bdfcf5c1c2e/advertion-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1f22090a98355115397059e44fd69f18d0c44ece71fa89f6a6677cc03a390b0b",
"md5": "8b7373d4854c66daaae2cd6086a65116",
"sha256": "ef6c9e64874d4ceb32873dd14126e13c86dea41c7628351e358fc684641f390f"
},
"downloads": -1,
"filename": "advertion-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "8b7373d4854c66daaae2cd6086a65116",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.12,>=3.8.6",
"size": 5636,
"upload_time": "2024-12-12T10:26:08",
"upload_time_iso_8601": "2024-12-12T10:26:08.269474Z",
"url": "https://files.pythonhosted.org/packages/1f/22/090a98355115397059e44fd69f18d0c44ece71fa89f6a6677cc03a390b0b/advertion-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-12 10:26:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ilias-ant",
"github_project": "adversarial-validation",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "advertion"
}