Skip to main content

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 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 hashes
Filename, size xai-metrics-0.0.2.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page