Skip to main content

Package for Machine Learning explanation in Python.

Project description

codecov GitHub - License Lint Continuous Integration Continuous Deployment PyPi package

TEACHER: Trustable Extensible Aggregator of CompreHensive Explainers

TEACHER is an open source Python Library that incorporates several state-of-the-art explainability techniques that can be used for model interpretation and explanation. The objective of the library is to be extensible with new tools and algorithms while keeping compatibility with the most used machine learning models such as scikit-learn.

This project was started in 2020 as the Ph.D. Thesis of Guillermo Tomás Fernández Martín, whose advisors are José Antonio Gámez Martín and José Miguel Puerta Callejón.

Website: https://xai-teacher.readthedocs.io/en/latest/

Installation

Dependencies

Teacher requires:

* Python (>=3.9)
* scikit-learn 
* scikit-fuzzy
* matplotlib (for plotting functions)
* deap (for compatibility with the LORE algorithm)
* imblearn (for compatibility with the LORE algorithm)

IMPORTANT Install scikit-fuzzy from their GitHub as the PyPi version is obsolete:

pip install git+https://github.com/scikit-fuzzy/scikit-fuzzy

User installation

If you already have a working installation, you can install teacher with

pip install -U teacher-xai

The documentation includes more detailed instructions.

Usage

For detailed instructions on how to use teacher, please refer to the API Reference

Supported Methods

The following list summarizes the models and explainers currently supported

  • Fuzzy Factuals and Counterfactuals: Explainer obtained from a fuzzy tree that can be used for global or local explanations
  • LORE: Local explainer generated from a neighborhood
  • FLARE: Fuzzy local explainer generated from a neighborhood

Metrics

The following list summarizes the metrics and scores that can be extracted from the explainers

General metrics

  • Coverage: How many instances are covered by the rules forming the explanation
  • Precision: How many of the instances covered by the rules forming the explanation are properly classified

Local neighborhood metrics

  • Fidelity: How good is the local explainer at mimicking the global classifier in the neighborhood
  • L-fidelity (Rule fidelity): How good is the local explainer at mimicking the global classifier in the instances of the neighborhood covered by the factual explanation
  • Cl-fidelity: How good is the local explainer at mimicking the global classifier in the instances of the neighborhood covered by the counterfactual explanation (To be implemented)
  • Hit: Does the local explainer match the global classifier result? (To be implemented)
  • C-hit: Does the local explainer match the global classifier result for tan instance built from the counterfactual rule? (To be implemented)

References and Examples

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

teacher-xai-1.0.1.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

teacher_xai-1.0.1-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file teacher-xai-1.0.1.tar.gz.

File metadata

  • Download URL: teacher-xai-1.0.1.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for teacher-xai-1.0.1.tar.gz
Algorithm Hash digest
SHA256 841db2695841a64caa6e7e5c815387e648cb41ae912ba7b68702865f1d4fdd25
MD5 baeb9836ff05547dad29c5222c4c9e7a
BLAKE2b-256 b74e4d00ff6a1cb7f14e4f2b365ab9de3d4100808b0f4ae2e90212b33c4eb131

See more details on using hashes here.

File details

Details for the file teacher_xai-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: teacher_xai-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for teacher_xai-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b757799de6c1663ab022ffc508efc07c67bf83a649cfbe15776d00ef1366ebf7
MD5 4668ac4b827483debe1055157eee437c
BLAKE2b-256 cd02fb0787f57d1f90c037c0aac53cf1d0401f123f963c4a438379e4a5295194

See more details on using hashes here.

Supported by

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