Skip to main content

A package for DeltaXplainer model implemented from the paper https://arxiv.org/pdf/2309.17095.pdf

Project description

DeltaXplainer, XAI model comparison and explanations

Documentation Status (documentation not up to date)

Package for DeltaXplainer model implemented from the paper Dynamic Interpretability for Model Comparison via Decision Rules, A Rida, MJ Lesot, X Renard, C Marsala, DynXAI workshop at ECML PKDD 2023, https://arxiv.org/pdf/2309.17095.pdf

DeltaXplainer is an algortihm aiming at explaining differences between two black box binary classifiers.

DeltaXplainer Schema

The models takes as input the two models to compare and generate explanations. The package is originally built to support comparison of sklearn models but any object with a predict method doing binary classification should work.

The explanations are provided using decision rules. We propose to answer to the question "Why are the models different?" by showing "Where" they differ.

The explanations are a list of segments where the two black box models make different predictions.

Ideas for future improvements include considering other explanations format and ways to extract knowledge from the delta model.

Installation

pip install deltaxplainer

Getting Started

In order to have a hands on example please refer to this notebook

Generating Explanations

Assuming you want to explain differences between classifer_a and classifer_b trained on X_a, y_a and X_b, y_b

For more details on how the method works please refer to the original paper.

from deltaxplainer import DeltaXplainer

X_delta_train = pd.concat([X_a, X_b])

delta_model = DeltaXplainer(X_delta_train, model_a, model_b).fit()

print(delta_model.segments)

This last line gives you a list of segments where the two models differ.

[under construction]

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

deltaxplainer-1.1.1.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file deltaxplainer-1.1.1.tar.gz.

File metadata

  • Download URL: deltaxplainer-1.1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.3

File hashes

Hashes for deltaxplainer-1.1.1.tar.gz
Algorithm Hash digest
SHA256 22ff0c27df4d65ae4beff547f5e233aa7fc06932ebc9a015618b66355d4869fd
MD5 89d15b0002001011521fded4e89c458f
BLAKE2b-256 f29494b886e848033fe1b123c20b0d3e9324e1350f3b7bb6b7f48a261bfaa5c1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page