A model explainability toolkit with SHAP, LIME, scoring, summaries, and GUI sandbox
Project description
Model Explainability Toolkit
This toolkit provides SHAP and LIME-based explanations for scikit-learn models, along with visualization tools.
Features
- SHAP and LIME explainers
- Feature importance plots
- Modular design for easy extension
Example
from model_explain.explainers import shap_explainer
from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
import pandas as pd
# Load data
data = load_iris()
X = pd.DataFrame(data.data, columns=data.feature_names)
y = pd.Series(data.target)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
# Train model
my_model = RandomForestClassifier()
my_model.fit(X_train, y_train)
# Explain model
shap_explainer.shap_explainer(my_model, X_test)
Usage
See examples/demo_notebook.ipynb for a walkthrough.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
model_explain-0.1.0.tar.gz
(9.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file model_explain-0.1.0.tar.gz.
File metadata
- Download URL: model_explain-0.1.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
639f356bb38fa95199c997a34dfc2d29b57f48cb210a1712e5a90c9ef54ac0ac
|
|
| MD5 |
0952f5d29658ac81b8da5387f0c82cdb
|
|
| BLAKE2b-256 |
b2a9d2384562d8e1c351362a7239d734222bfd7b73081782a3b8d25b33a494d0
|
File details
Details for the file model_explain-0.1.0-py3-none-any.whl.
File metadata
- Download URL: model_explain-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3ff7ea16ea945744b6397bde7e01180d1dfd7ce80cdff1820ce5132138fe303
|
|
| MD5 |
8ba9bcc73280e4ff6ec1a6d4202ee98c
|
|
| BLAKE2b-256 |
82768755fdc7fc0c2fb4ee7e3c366b0511b21e18dfe91e2815b7a55ace0dcbf2
|