A package for analysis and evaluating metrics for Explainable AI (XAI)
Project description
XAI-metrics
A package for analysis and evaluating metrics for machine learning models explainability.
Installation
Install from PyPI:
pip install xai-metrics
Usage
Examples of usage:
- Perturbation based on permutation importances
from xai_metrics import examine_interpretation
X_train.columns = ['0','1','2','3']
X_test.columns = ['0','1','2','3']
xgb_model = xgb.XGBClassifier()
xgb_model.fit(X_train, y_train)
perm = PermutationImportance(xgb_model, random_state=1).fit(X_test, y_test)
perm_importances = perm.feature_importances_
examine_interpretation(xgb_model, X_test, y_test, perm_importances, epsilon=4, resolution=50, proportionality_mode=0)
- Perturbation based on local importances
from xai_metrics import examine_local_fidelity
examine_local_fidelity(xgb_model, X_test, y_test, epsilon=3)
- Gradual elimination
from xai_metrics import gradual_elimination
gradual_elimination(f_forest, f_X_test, f_y_test, f_shap)
See here for notebooks with full examples of usage.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
xai-metrics-0.0.2.tar.gz
(5.2 kB
view details)
Built Distribution
File details
Details for the file xai-metrics-0.0.2.tar.gz
.
File metadata
- Download URL: xai-metrics-0.0.2.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5fa4818095be5ba1263f83cc2bc13f6ca145b85827fcf57c735734b81e5f8ce |
|
MD5 | 45ae706f1d93edd320740211758fc3fa |
|
BLAKE2b-256 | c25376b8582ebcfaa9a7ec3a5e2d3bfb4625c35c70a8802d63a02660cdf0b5c3 |
File details
Details for the file xai_metrics-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: xai_metrics-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f38b181f47e4ec1b05fcb4078f56e29aa77ddb0227c60edc4c2d9474d710b03 |
|
MD5 | f041ea2dca48854d452e3a7821cc091c |
|
BLAKE2b-256 | 7c9c6618a8a74e7506cf3e2d4970217466d566af90748f8237f8dbc573c0ea64 |