{"id":13780132,"url":"https://github.com/MarcelRobeer/explabox","last_synced_at":"2025-05-11T13:31:34.691Z","repository":{"id":44458019,"uuid":"490664486","full_name":"MarcelRobeer/explabox","owner":"MarcelRobeer","description":"Explore/examine/explain/expose your model with the explabox!","archived":false,"fork":false,"pushed_at":"2024-03-18T12:35:14.000Z","size":2793,"stargazers_count":13,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-20T18:14:06.488Z","etag":null,"topics":["explainable-ai","explainable-ml","fairness","interpretable-machine-learning","machine-learning","python","responsible-ai","robustness"],"latest_commit_sha":null,"homepage":"https://explabox.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarcelRobeer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-10T11:20:18.000Z","updated_at":"2024-08-03T18:11:54.055Z","dependencies_parsed_at":"2024-01-13T11:57:59.042Z","dependency_job_id":"879c6104-1010-42a1-8673-413e69dd4d62","html_url":"https://github.com/MarcelRobeer/explabox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelRobeer%2Fexplabox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelRobeer%2Fexplabox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelRobeer%2Fexplabox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcelRobeer%2Fexplabox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcelRobeer","download_url":"https://codeload.github.com/MarcelRobeer/explabox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225056763,"owners_count":17414204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["explainable-ai","explainable-ml","fairness","interpretable-machine-learning","machine-learning","python","responsible-ai","robustness"],"created_at":"2024-08-03T18:01:12.641Z","updated_at":"2025-05-11T13:31:34.607Z","avatar_url":"https://github.com/MarcelRobeer.png","language":"Python","funding_links":[],"categories":["Python Libraries(sort in alphabeta order)","Technical Resources","Explainability, counterfactuals and probing"],"sub_categories":["Evaluation methods","Open Source/Access Responsible AI Software Packages"],"readme":"*\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/MarcelRobeer/explabox/blob/main/img/explabox.png?raw=true\" alt=\"explabox logo\"\u003e*\n\u003c/p\u003e\n\n**\u003ch3 align=\"center\"\u003e\n\"{`Explore` | `Examine` | `Expose` | `Explain`} your model with the *explabox*!\"**\n\u003c/h3\u003e\n\n---\n\n| Status | |\n|:-----------------|:------------------\n| _Latest release_ | [![PyPI](https://img.shields.io/pypi/v/explabox)](https://pypi.org/project/explabox/)  [![Downloads](https://pepy.tech/badge/explabox)](https://pepy.tech/project/explabox)  [![Python_version](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)](https://pypi.org/project/explabox/)  [![License](https://img.shields.io/pypi/l/explabox)](https://www.gnu.org/licenses/lgpl-3.0.en.html)\n| _Development_ | [![Lint, Security \u0026 Tests](https://github.com/MarcelRobeer/explabox/actions/workflows/check.yml/badge.svg)](https://github.com/MarcelRobeer/explabox/actions/workflows/check.yml)  [![codecov](https://codecov.io/gh/MarcelRobeer/explabox/branch/main/graph/badge.svg?token=7XVEUE5PDM)](https://codecov.io/gh/MarcelRobeer/explabox)  [![Documentation Status](https://readthedocs.org/projects/explabox/badge/?version=latest)](https://explabox.readthedocs.io/en/latest/?badge=latest)  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n---\n\nThe `explabox` aims to support data scientists and machine learning (ML) engineers in explaining, testing and documenting AI/ML models, developed in-house or acquired externally. The `explabox` turns your **ingestibles** (AI/ML model and/or dataset) into **digestibles** (statistics, explanations or sensitivity insights)!\n\n*\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/MarcelRobeer/explabox/blob/main/img/ingestibles-to-digestibles.png?raw=true\" alt=\"ingestibles to digestibles\"\u003e*\n\u003c/p\u003e\n\nThe `explabox` can be used to:\n\n- __Explore__: describe aspects of the model and data.\n- __Examine__: calculate quantitative metrics on how the model performs.\n- __Expose__: see model sensitivity to random inputs (_safety_), test model generalizability (e.g. sensitivity to typos; _robustness_), and see the effect of adjustments of attributes in the inputs (e.g. swapping male pronouns for female pronouns; _fairness_), for the dataset as a whole (_global_) as well as for individual instances (_local_).\n- __Explain__: use XAI methods for explaining the whole dataset (_global_), model behavior on the dataset (_global_), and specific predictions/decisions (_local_).\n\nA number of experiments in the `explabox` can also be used to provide transparency and explanations to stakeholders, such as end-users or clients.\n\n\u003e :information_source: The `explabox` currently only supports natural language text as a modality. In the future, we intend to extend to other modalities.\n\n\u0026copy; National Police Lab AI (NPAI), 2022\n\n\u003ca name=\"quick-tour\"/\u003e\u003c/a\u003e\n## Quick tour\nThe `explabox` is distributed on [PyPI](https://pypi.org/project/explabox/). To use the package with Python, install it (`pip install explabox`), import your `data` and `model` and wrap them in the `Explabox`:\n\n```python\n\u003e\u003e\u003e from explabox import import_data, import_model\n\u003e\u003e\u003e data = import_data('./drugsCom.zip', data_cols='review', label_cols='rating')\n\u003e\u003e\u003e model = import_model('model.onnx', label_map={0: 'negative', 1: 'neutral', 2: 'positive'})\n\n\u003e\u003e\u003e from explabox import Explabox\n\u003e\u003e\u003e box = Explabox(data=data,\n...                model=model,\n...                splits={'train': 'drugsComTrain.tsv', 'test': 'drugsComTest.tsv'})\n```\n\nThen `.explore`, `.examine`, `.expose` and `.explain` your model:\n```python\n\u003e\u003e\u003e # Explore the descriptive statistics for each split\n\u003e\u003e\u003e box.explore()\n```\n\u003cimg src=\"https://github.com/MarcelRobeer/explabox/blob/main/img/example/drugscom_explore.png?raw=true\" alt=\"drugscom_explore\" width=\"600\"/\u003e\n\n```python\n\u003e\u003e\u003e # Show wrongly classified instances\n\u003e\u003e\u003e box.examine.wrongly_classified()\n```\n\u003cimg src=\"https://github.com/MarcelRobeer/explabox/blob/main/img/example/drugscom_examine.png?raw=true\" alt=\"drugscom_examine\" width=\"600\"/\u003e\n\n```python\n\u003e\u003e\u003e # Compare the performance on the test split before and after adding typos to the text\n\u003e\u003e\u003e box.expose.compare_metrics(split='test', perturbation='add_typos')\n```\n\u003cimg src=\"https://github.com/MarcelRobeer/explabox/blob/main/img/example/drugscom_expose.png?raw=true\" alt=\"drugscom_expose\" width=\"600\"/\u003e\n\n```python\n\u003e\u003e\u003e # Get a local explanation (uses LIME by default)\n\u003e\u003e\u003e box.explain.explain_prediction('Hate this medicine so much!')\n```\n\u003cimg src=\"https://github.com/MarcelRobeer/explabox/blob/main/img/example/drugscom_explain.png?raw=true\" alt=\"drugscom_explain\" width=\"600\"/\u003e\n\n\nFor more information, visit the [explabox documentation](https://explabox.rtfd.io).\n\n# Contents\n- [Quick tour](#quick-tour)\n- [Installation](#installation)\n- [Documentation](#documentation)\n- [Example usage](#example-usage)\n- [Releases](#releases)\n- [Contributing](#contributing)\n- [Citation](#citation)\n\n\u003ca name=\"installation\"/\u003e\u003c/a\u003e\n## Installation\nThe easiest way to install the latest release of the `explabox` is through `pip`:\n\n```console\nuser@terminal:~$ pip install explabox\nCollecting explabox\n...\nInstalling collected packages: explabox\nSuccessfully installed explabox\n```\n\n\u003e :information_source: The `explabox` requires _Python 3.8_ or above.\n\nSee the [full installation guide](INSTALLATION.md) for troubleshooting the installation and other installation methods.\n\n\u003ca name=\"documentation\"/\u003e\u003c/a\u003e\n## Documentation\nDocumentation for the `explabox` is hosted externally on [explabox.rtfd.io](https://explabox.rtfd.io).\n\n\u003cimg src=\"https://github.com/MarcelRobeer/explabox/blob/main/img/layers.png?raw=true\" alt=\"layers\" width=\"400\"/\u003e\n\nThe `explabox` consists of three layers:\n1. __Ingestibles__ provide a unified interface for importing models and data, which abstracts away how they are accessed and allows for optimized processing.\n2. __Analyses__ are used to turn opaque ingestibles into transparent digestibles. The four types of analyses are _explore_, _examine_, _explain_ and _expose_.\n3. __Digestibles__ provide insights into model behavior and data, assisting stakeholders in increasing the explainability, fairness, auditability and safety of their AI systems. Depending on their needs, these can be accessed interactively (e.g. via the Jupyter Notebook UI or embedded via the API) or through static reporting.\n\n\u003ca name=\"example-usage\"/\u003e\u003c/a\u003e\n## Example usage\nThe [example usage guide](EXAMPLE_USAGE.md) showcases the `explabox` for a black-box model performing multi-class classification of the [UCI Drug Reviews](https://archive.ics.uci.edu/ml/datasets/Drug+Review+Dataset+%28Drugs.com%29#) dataset.\n\nWithout requiring any local installations, the notebook is provided on [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/14lXvXV01DaSruSAhD1RLbILRl2mPQ4nS?usp=sharing).\n\nIf you want to follow along on your own device, simply `pip install explabox-demo-drugreview` and run the lines in the [Jupyter notebook](https://git.science.uu.nl/m.j.robeer/explabox-demo-drugreview/-/blob/main/explabox_demo_drugreview.ipynb) we have prepared for you!\n\n\u003ca name=\"releases\"/\u003e\u003c/a\u003e\n## Releases\nThe `explabox` is officially released through [PyPI](https://pypi.org/project/explabox/). The [changelog](CHANGELOG.md) includes a full overview of the changes for each version.\n\n\u003ca name=\"contributing\"/\u003e\u003c/a\u003e\n## Contributing\nThe `explabox` is an open-source project developed and maintained primarily by the Netherlands *National Police Lab AI* (NPAI). However, your contributions and improvements are still required! See [contributing](CONTRIBUTING.md) for a full contribution guide.\n\n\u003ca name=\"citation\"\u003e\u003c/a\u003e\n## Citation\nIf you use the Explabox in your work, please read the corresponding paper at [doi:10.48550/arXiv.2411.15257](https://doi.org/10.48550/arXiv.2411.15257), and cite the paper as follows:\n\n```bibtex\n@misc{Robeer2024,\n  title = {{The Explabox: Model-Agnostic Machine Learning Transparency \\\u0026 Analysis}},\n  author = {Robeer,  Marcel and Bron,  Michiel and Herrewijnen,  Elize and Hoeseni,  Riwish and Bex,  Floris},\n  publisher = {arXiv},\n  doi = {10.48550/arXiv.2411.15257},\n  url = {https://arxiv.org/abs/2411.15257},\n  year = {2024},\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarcelRobeer%2Fexplabox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMarcelRobeer%2Fexplabox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarcelRobeer%2Fexplabox/lists"}