Skip to main content

XAI Lens

Developed as part of my MSc project, XAI Lens allows model developers to compare Explainable AI methods and explanations between models, including scikit-learn models and LLMs.

As this is a proof of concept framework, not all model, XAI method or visualisation types have been developed. However, the architecture allows new model types, XAI methods and visualisations to be added without large changes to the codebase.

Demo & Documentation

Demo available at: https://xailens.alexlittle.net/

Documentation available at: https://xailens-docs.alexlittle.net/

Install

  • Install with pip install xailens
  • Launch the dashboard with xailens-dash

Repository Structure

An overview of this repository's directory and file structure. Note that not every directory/file is included here.

.
├── docs                     # Documentation in Sphinx RST format
├── examples                 # Example models used in the demo              
├── tests                    # Tests - dir/file structure mirrors the xailens 
│                            # core package structure
├── xailens                    # Core XAI Lens code
│   ├── adapters                 # Adapters
│   │   ├── explainers             # Adapters for XAI methods (eg TreeShap)
│   │   ├── models                 # Adapters for model types (eg LLM, XGBoost)
│   │   └── viz                    # Adapters for visualisations (eg bar chart)
│   ├── dashboard                # Streamlit dashboard application
│   │   ├── assets                 # CSS, logo/icons etc
│   │   ├── pages                  # Streamlit pages
│   │   ├── utils                  # Helper functions/utilities/components for pages
│   │   ├── app.py                 # Dashboard start up
│   │   ├── explorer.py            # Memory caching of model_explorer class
│   │   └── settings.py            # Dashboard settings
│   ├── entities                 # Helper classes for library and dashboard
│   │   ├── context.py             # Dataclasses for sending model to framework
│   │   ├── dataset.py             # Dataset class (represents a dataset)
│   │   ├── model_explorer.py      # Explorer class (for dataset, models available)
│   │   ├── model.py               # Model class
│   │   └── schema.py              # Dataclass for model data description
│   ├── registry                 # Adapter registries
│   │   ├── autodiscover.py        # Autodiscovers the adapters available
│   │   ├── model_registry.py      # Registry for model adapters
│   │   ├── viz_registry.py        # Registry for visualisation adapters
│   │   └── xai_registry.py        # Registry for XAi method adapters
│   ├── storage                  # Storage classes
│   │   ├── filesystem_store.py    # Filesystem store class
│   │   └── store_base.py          # Base (abstract) store class
│   ├── artifacts.py             # Artifact store - manages models and storage
│   ├── cli.py                   # Command line interface for launching dashboard
│   ├── config.py                # XAI Lens configuration
│   ├── exceptions.py            # Custom exceptions
│   ├── runner.py                # Orchestrator/entry point for loading a model
│   ├── strings.py               # Strings used throughout library
│   └── _version.py              # library version number
├── LICENSE                    # GNU 3 open Source license
├── pyproject.toml             # Project/pip install file
├── README.md                  # This readme file
├── requirements-dev.txt       # Required packages if developing more features 
├── requirements-examples.txt  # Required packages for running the example models
├── requirements.txt           # Core required packages
├── setup.py                   # Project/pip install file
└── sonar-project.properties   # SonarQube configuration file   

Source code/Development

This repo uses Git LFS for large files. Before cloning, install Git LFS:

sudo apt install git-lfs 
git lfs install

CI & Code Quality

Continuous Integration

CI

SonarCloud — Quality Overview

Quality Gate Coverage

Detailed Metrics

Maintainability Reliability Security

Issues Breakdown

Bugs Vulnerabilities Code Smells

Download files

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

Source Distribution

xailens-0.2.0.tar.gz (57.8 kB view details)

Uploaded Source

Built Distribution

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

xailens-0.2.0-py3-none-any.whl (73.2 kB view details)

Uploaded Python 3

File details

Details for the file xailens-0.2.0.tar.gz.

File metadata

  • Download URL: xailens-0.2.0.tar.gz
  • Upload date:
  • Size: 57.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for xailens-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fb712eba6cfc1fdf4425367b9a8d7114edd777de72b564019c0cd2e04b4a5512
MD5 d1fd0de89d5ae0f702916e4a9059b112
BLAKE2b-256 f40380126c07afbf188e55cef69e0ee896f75abde6d0acb6ceabc66ab10ac54b

See more details on using hashes here.

File details

Details for the file xailens-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: xailens-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 73.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for xailens-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53af96fd2a0ec613273351b5b7d67776b0fb0b8ee1a4e93030f7c1a7362e0052
MD5 cc7cc0706d62cb482846d7f3322e12b8
BLAKE2b-256 ccb2e4a8c3f3910c42ffeb494dcbee79ed4e5ce2d313137ea2eda88e6e647957

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page