Skip to main content

A package for analysis and evaluating metrics for Explainable AI (XAI)

Project description


A package for analysis and evaluating metrics for machine learning models explainability.


Install from PyPI:

pip install xai-metrics


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(), 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 permutation importances

  • Perturbation based on local importances
from xai_metrics import examine_local_fidelity

examine_local_fidelity(xgb_model, X_test, y_test, epsilon=3)

Perturbation based on permutation importances

  • Gradual elimination
from xai_metrics import gradual_elimination

gradual_elimination(f_forest, f_X_test, f_y_test, f_shap)

Perturbation based on permutation importances

See here for notebooks with full examples of usage.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for xai-metrics, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size xai_metrics-0.0.2-py3-none-any.whl (6.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size xai-metrics-0.0.2.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page