# Explainiverse
**Explainiverse** is a unified, extensible, and testable Python framework for Explainable AI (XAI).
It offers a standardized interface for model-agnostic explainability, evaluation metrics like AOPC and ROAR, and support for multiple XAI methods out of the box.
---
## Features
- Standardized `Explainer` API (`BaseExplainer`)
- Support for:
- Local and global feature attribution
- Regression and classification tasks
- Integrated explainers:
- **LIME** (tabular, local surrogate)
- **SHAP** (KernelExplainer with multi-class, regression, cohort support)
- Evaluation metrics:
- **AOPC** (Area Over Perturbation Curve)
- **ROAR** (Remove And Retrain)
- Multiple `top_k` support
- Baseline options: `"mean"`, `"median"`, `np.ndarray`, `callable`
- Curve generation for ROAR vs feature importance
- Explainability Suite:
- Run and compare multiple explainers
- Auto-suggestion based on model/task type
- Built-in support for models: `LogisticRegression`, `RandomForest`, `SVC`, `KNN`, `XGB`, `NaiveBayes`, and more
---
## Installation
From PyPI:
```bash
pip install explainiverse
```
For development use:
```bash
git clone https://github.com/jemsbhai/explainiverse.git
cd explainiverse
poetry install
```
---
## Quick Example
```python
from explainiverse.adapters.sklearn_adapter import SklearnAdapter
from explainiverse.explainers.attribution.lime_wrapper import LimeExplainer
from explainiverse.engine.suite import ExplanationSuite
# Wrap your model
adapter = SklearnAdapter(your_model, class_names=["yes", "no"])
# Build the suite
suite = ExplanationSuite(
model=adapter,
explainer_configs=[
("lime", {...}),
("shap", {...})
],
data_meta={"task": "classification"}
)
results = suite.run(instance)
suite.compare()
suite.evaluate_roar(X_train, y_train, X_test, y_test, top_k=3)
```
---
## Running Tests
All tests can be run using:
```bash
poetry run python tests/test_all.py
```
For individual component testing:
```bash
poetry run python tests/test_shap_explainer.py
poetry run python tests/test_lime_explainer.py
poetry run python tests/test_evaluation_metrics.py
```
---
## Documentation
Documentation is currently in development.
Until then, test files (especially `test_shap_explainer.py`) demonstrate usage and structure.
---
## License
This project is licensed under the MIT License.
Raw data
{
"_id": null,
"home_page": "https://github.com/jemsbhai/explainiverse",
"name": "explainiverse",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Muntaser Syed",
"author_email": "jemsbhai@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/57/d7/1c244ed4bc42ea292ca93b64f518d85a5792081127dade05d1f3604c35db/explainiverse-0.1.1a1.tar.gz",
"platform": null,
"description": "# Explainiverse\n\n**Explainiverse** is a unified, extensible, and testable Python framework for Explainable AI (XAI). \nIt offers a standardized interface for model-agnostic explainability, evaluation metrics like AOPC and ROAR, and support for multiple XAI methods out of the box.\n\n---\n\n## Features\n\n- Standardized `Explainer` API (`BaseExplainer`)\n- Support for:\n - Local and global feature attribution\n - Regression and classification tasks\n- Integrated explainers:\n - **LIME** (tabular, local surrogate)\n - **SHAP** (KernelExplainer with multi-class, regression, cohort support)\n- Evaluation metrics:\n - **AOPC** (Area Over Perturbation Curve)\n - **ROAR** (Remove And Retrain)\n - Multiple `top_k` support\n - Baseline options: `\"mean\"`, `\"median\"`, `np.ndarray`, `callable`\n - Curve generation for ROAR vs feature importance\n- Explainability Suite:\n - Run and compare multiple explainers\n - Auto-suggestion based on model/task type\n- Built-in support for models: `LogisticRegression`, `RandomForest`, `SVC`, `KNN`, `XGB`, `NaiveBayes`, and more\n\n---\n\n\n## Installation\n\nFrom PyPI:\n\n```bash\npip install explainiverse\n```\n\nFor development use:\n\n```bash\ngit clone https://github.com/jemsbhai/explainiverse.git\ncd explainiverse\npoetry install\n```\n\n---\n\n## Quick Example\n```python\n\nfrom explainiverse.adapters.sklearn_adapter import SklearnAdapter\nfrom explainiverse.explainers.attribution.lime_wrapper import LimeExplainer\nfrom explainiverse.engine.suite import ExplanationSuite\n\n# Wrap your model\nadapter = SklearnAdapter(your_model, class_names=[\"yes\", \"no\"])\n\n# Build the suite\nsuite = ExplanationSuite(\n model=adapter,\n explainer_configs=[\n (\"lime\", {...}),\n (\"shap\", {...})\n ],\n data_meta={\"task\": \"classification\"}\n)\n\nresults = suite.run(instance)\nsuite.compare()\nsuite.evaluate_roar(X_train, y_train, X_test, y_test, top_k=3)\n```\n\n\n---\n\n## Running Tests\n\nAll tests can be run using:\n\n```bash\npoetry run python tests/test_all.py\n```\n\nFor individual component testing:\n\n```bash\npoetry run python tests/test_shap_explainer.py\npoetry run python tests/test_lime_explainer.py\npoetry run python tests/test_evaluation_metrics.py\n```\n\n---\n\n## Documentation\n\nDocumentation is currently in development. \nUntil then, test files (especially `test_shap_explainer.py`) demonstrate usage and structure.\n\n---\n\n## License\n\nThis project is licensed under the MIT License.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Unified, extensible explainability framework supporting LIME, SHAP, and custom adapters",
"version": "0.1.1a1",
"project_urls": {
"Homepage": "https://github.com/jemsbhai/explainiverse",
"Repository": "https://github.com/jemsbhai/explainiverse"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1fb22b38d5153bd5708459ae2d0155efec5bc8d4dcae4b3cb23b4a01ce53bc19",
"md5": "eb0609d895080b79cad335e6c3e9a55a",
"sha256": "ade6de7672de4ea1eecc6a7abab983a86b1ac0618e6d542b9aa743b91c5838e2"
},
"downloads": -1,
"filename": "explainiverse-0.1.1a1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "eb0609d895080b79cad335e6c3e9a55a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.10",
"size": 12590,
"upload_time": "2025-07-10T11:10:06",
"upload_time_iso_8601": "2025-07-10T11:10:06.866137Z",
"url": "https://files.pythonhosted.org/packages/1f/b2/2b38d5153bd5708459ae2d0155efec5bc8d4dcae4b3cb23b4a01ce53bc19/explainiverse-0.1.1a1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "57d71c244ed4bc42ea292ca93b64f518d85a5792081127dade05d1f3604c35db",
"md5": "052fca608c89ef6043f0732d0f040940",
"sha256": "6e01645c462e51a505896e290aa58d001dfaf93520fe5d062f314b94ac5da543"
},
"downloads": -1,
"filename": "explainiverse-0.1.1a1.tar.gz",
"has_sig": false,
"md5_digest": "052fca608c89ef6043f0732d0f040940",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.10",
"size": 9563,
"upload_time": "2025-07-10T11:10:07",
"upload_time_iso_8601": "2025-07-10T11:10:07.753979Z",
"url": "https://files.pythonhosted.org/packages/57/d7/1c244ed4bc42ea292ca93b64f518d85a5792081127dade05d1f3604c35db/explainiverse-0.1.1a1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-10 11:10:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jemsbhai",
"github_project": "explainiverse",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "explainiverse"
}