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 visualization types have been developed. However, the architecture allows new model types, XAI methods and visualizations to be added without large changes to the codebase.

Demo

Demo available at: https://xailens.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 visualizations (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 visualization 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.1.tar.gz (60.2 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.1-py3-none-any.whl (74.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xailens-0.2.1.tar.gz
  • Upload date:
  • Size: 60.2 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.1.tar.gz
Algorithm Hash digest
SHA256 453c6be4e2238f9d39e89fa62bd97a0584643861c7f26243223a69d20d18c4cf
MD5 1ac0cfdb31b30e1574401d4590adabd2
BLAKE2b-256 bfb43c1c2166cf43d4fc6c27b10a62efed1919908330dcafddefe59777ad04c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xailens-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 74.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9f9d4a2a59cca6286a3c8fa487b7f58374417b747c83c620e16f45bb0e69a7f0
MD5 6f2d4ab266b454f0163e9af9d5a6ac66
BLAKE2b-256 0dac7f37a3fc0323d557c96c5d4b78d761564afe7ff08d21af83ade038f810a0

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

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