explainiverse 0.1.1a1__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- explainiverse/__init__.py +45 -1
- explainiverse/adapters/__init__.py +9 -0
- explainiverse/adapters/base_adapter.py +25 -25
- explainiverse/adapters/sklearn_adapter.py +32 -32
- explainiverse/core/__init__.py +22 -0
- explainiverse/core/explainer.py +31 -31
- explainiverse/core/explanation.py +24 -24
- explainiverse/core/registry.py +545 -0
- explainiverse/engine/__init__.py +8 -0
- explainiverse/engine/suite.py +142 -142
- explainiverse/evaluation/__init__.py +8 -0
- explainiverse/evaluation/metrics.py +232 -232
- explainiverse/explainers/__init__.py +38 -0
- explainiverse/explainers/attribution/__init__.py +9 -0
- explainiverse/explainers/attribution/lime_wrapper.py +90 -63
- explainiverse/explainers/attribution/shap_wrapper.py +89 -66
- explainiverse/explainers/counterfactual/__init__.py +8 -0
- explainiverse/explainers/counterfactual/dice_wrapper.py +302 -0
- explainiverse/explainers/global_explainers/__init__.py +23 -0
- explainiverse/explainers/global_explainers/ale.py +191 -0
- explainiverse/explainers/global_explainers/partial_dependence.py +192 -0
- explainiverse/explainers/global_explainers/permutation_importance.py +123 -0
- explainiverse/explainers/global_explainers/sage.py +164 -0
- explainiverse/explainers/rule_based/__init__.py +8 -0
- explainiverse/explainers/rule_based/anchors_wrapper.py +350 -0
- explainiverse-0.2.0.dist-info/METADATA +264 -0
- explainiverse-0.2.0.dist-info/RECORD +29 -0
- explainiverse-0.1.1a1.dist-info/METADATA +0 -128
- explainiverse-0.1.1a1.dist-info/RECORD +0 -19
- {explainiverse-0.1.1a1.dist-info → explainiverse-0.2.0.dist-info}/LICENSE +0 -0
- {explainiverse-0.1.1a1.dist-info → explainiverse-0.2.0.dist-info}/WHEEL +0 -0
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: explainiverse
|
|
3
|
-
Version: 0.1.1a1
|
|
4
|
-
Summary: Unified, extensible explainability framework supporting LIME, SHAP, and custom adapters
|
|
5
|
-
Home-page: https://github.com/jemsbhai/explainiverse
|
|
6
|
-
License: MIT
|
|
7
|
-
Author: Muntaser Syed
|
|
8
|
-
Author-email: jemsbhai@gmail.com
|
|
9
|
-
Requires-Python: >=3.10,<3.13
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
-
Requires-Dist: lime (>=0.2.0.1,<0.3.0.0)
|
|
16
|
-
Requires-Dist: numpy (==1.24.4)
|
|
17
|
-
Requires-Dist: scikit-learn (>=1.1,<1.4)
|
|
18
|
-
Requires-Dist: shap (>=0.48.0,<0.49.0)
|
|
19
|
-
Requires-Dist: xgboost (>=3.0.2,<4.0.0)
|
|
20
|
-
Project-URL: Repository, https://github.com/jemsbhai/explainiverse
|
|
21
|
-
Description-Content-Type: text/markdown
|
|
22
|
-
|
|
23
|
-
# Explainiverse
|
|
24
|
-
|
|
25
|
-
**Explainiverse** is a unified, extensible, and testable Python framework for Explainable AI (XAI).
|
|
26
|
-
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.
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Features
|
|
31
|
-
|
|
32
|
-
- Standardized `Explainer` API (`BaseExplainer`)
|
|
33
|
-
- Support for:
|
|
34
|
-
- Local and global feature attribution
|
|
35
|
-
- Regression and classification tasks
|
|
36
|
-
- Integrated explainers:
|
|
37
|
-
- **LIME** (tabular, local surrogate)
|
|
38
|
-
- **SHAP** (KernelExplainer with multi-class, regression, cohort support)
|
|
39
|
-
- Evaluation metrics:
|
|
40
|
-
- **AOPC** (Area Over Perturbation Curve)
|
|
41
|
-
- **ROAR** (Remove And Retrain)
|
|
42
|
-
- Multiple `top_k` support
|
|
43
|
-
- Baseline options: `"mean"`, `"median"`, `np.ndarray`, `callable`
|
|
44
|
-
- Curve generation for ROAR vs feature importance
|
|
45
|
-
- Explainability Suite:
|
|
46
|
-
- Run and compare multiple explainers
|
|
47
|
-
- Auto-suggestion based on model/task type
|
|
48
|
-
- Built-in support for models: `LogisticRegression`, `RandomForest`, `SVC`, `KNN`, `XGB`, `NaiveBayes`, and more
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
## Installation
|
|
54
|
-
|
|
55
|
-
From PyPI:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
pip install explainiverse
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
For development use:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
git clone https://github.com/jemsbhai/explainiverse.git
|
|
65
|
-
cd explainiverse
|
|
66
|
-
poetry install
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## Quick Example
|
|
72
|
-
```python
|
|
73
|
-
|
|
74
|
-
from explainiverse.adapters.sklearn_adapter import SklearnAdapter
|
|
75
|
-
from explainiverse.explainers.attribution.lime_wrapper import LimeExplainer
|
|
76
|
-
from explainiverse.engine.suite import ExplanationSuite
|
|
77
|
-
|
|
78
|
-
# Wrap your model
|
|
79
|
-
adapter = SklearnAdapter(your_model, class_names=["yes", "no"])
|
|
80
|
-
|
|
81
|
-
# Build the suite
|
|
82
|
-
suite = ExplanationSuite(
|
|
83
|
-
model=adapter,
|
|
84
|
-
explainer_configs=[
|
|
85
|
-
("lime", {...}),
|
|
86
|
-
("shap", {...})
|
|
87
|
-
],
|
|
88
|
-
data_meta={"task": "classification"}
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
results = suite.run(instance)
|
|
92
|
-
suite.compare()
|
|
93
|
-
suite.evaluate_roar(X_train, y_train, X_test, y_test, top_k=3)
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## Running Tests
|
|
100
|
-
|
|
101
|
-
All tests can be run using:
|
|
102
|
-
|
|
103
|
-
```bash
|
|
104
|
-
poetry run python tests/test_all.py
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
For individual component testing:
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
poetry run python tests/test_shap_explainer.py
|
|
111
|
-
poetry run python tests/test_lime_explainer.py
|
|
112
|
-
poetry run python tests/test_evaluation_metrics.py
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
## Documentation
|
|
118
|
-
|
|
119
|
-
Documentation is currently in development.
|
|
120
|
-
Until then, test files (especially `test_shap_explainer.py`) demonstrate usage and structure.
|
|
121
|
-
|
|
122
|
-
---
|
|
123
|
-
|
|
124
|
-
## License
|
|
125
|
-
|
|
126
|
-
This project is licensed under the MIT License.
|
|
127
|
-
|
|
128
|
-
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
explainiverse/__init__.py,sha256=bucmhjkOeGG8OigJFQscb0FSTLIyek52y1Jp8ZF_a4M,20
|
|
2
|
-
explainiverse/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
explainiverse/adapters/base_adapter.py,sha256=QANRbTFxrESM3ReT2kWR3c_CcWMDfKdl9fEbYZzzTuw,628
|
|
4
|
-
explainiverse/adapters/sklearn_adapter.py,sha256=WQC-i4OIaR0M-AILXV5OvNo9H2JA0dVMBYioalFOCu0,990
|
|
5
|
-
explainiverse/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
explainiverse/core/explainer.py,sha256=8vI_Paj1cpbhLK6GP1Ckq2SzW4FyjUgxOpuLKE12ddI,815
|
|
7
|
-
explainiverse/core/explanation.py,sha256=Gxz-0lU4YVZfV1Bsrzma7uvfze127aCmqDaVK1dg-hI,905
|
|
8
|
-
explainiverse/engine/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
explainiverse/engine/suite.py,sha256=brBQNCHMBobaOjSVpoBBsbo3gep9qbEcT0NSdU6SPxw,5056
|
|
10
|
-
explainiverse/evaluation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
explainiverse/evaluation/metrics.py,sha256=N_EucJ8Ud1Wa3IU6ZxzKKILF7UkQDLKEyhAvUaDHIGM,7685
|
|
12
|
-
explainiverse/explainers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
explainiverse/explainers/attribution/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
-
explainiverse/explainers/attribution/lime_wrapper.py,sha256=hFd6tQ7uE6R3ORHTuT-w2vW9JkvFuYbEZDpGqRLRNto,2107
|
|
15
|
-
explainiverse/explainers/attribution/shap_wrapper.py,sha256=yAQDZNPFbn_H0AMFhWKMEoQb8IG05Tg6oRBcWRw4CP8,2378
|
|
16
|
-
explainiverse-0.1.1a1.dist-info/LICENSE,sha256=28rbHe8rJgmUlRdxJACfq1Sj-MtCEhyHxkJedQd1ZYA,1070
|
|
17
|
-
explainiverse-0.1.1a1.dist-info/METADATA,sha256=rkIf7lkW6PaxJItQMdAamsOb4_DpBeVRxV0M16PrfR4,3263
|
|
18
|
-
explainiverse-0.1.1a1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
19
|
-
explainiverse-0.1.1a1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|