Skip to main content

Stability Indices for LIME

Build Status Binder PyPI - License PyPI PyPI - Downloads

This project is about measuring the stability of explanations obtained through the LIME tool.

LIME (Local Interpretable Model-agnostic Explanations) is a quite well-established albeit recent technique, which enables to understand Machine Learning model's reasoning.
For a deeper understanding of the technique, we suggest to read the paper by Ribeiro, as well as to watch its video.

Even though LIME is a great tool, it suffers from a lack of stability, namely repeated applications of the method, under the same conditions, may obtain different results. Even worse, many times the stability issue is not spotted at all by the practitioner, e.g. when just a single call to the method is performed and the result is considered to be okay without further checks.

An explanation can be considered reliable only if unambiguous.
Guided by this notion, we developed a pair of complementary indices to evaluate LIME stability: Variables Stability Index (VSI) and Coefficients Stability Index (CSI).

The method creates repeated LIME explanations for the same data point to be explained.
The VSI index checks whether the different LIMEs give back the same variables as explanation.
The CSI index controls whether the coefficients of each variable, under the repeated LIME calls, can be considered equal.

The indices can be calculated on every trained LIME method. Both of them range from 0 to 100, where higher values mean that the tested LIME is stable. They are designed to be used together, since each one tests a different concept of stability.

Using the indices will bring enhanced confidence in LIME's results: the practitioner may find out possible instability in its trained LIME, or he may vouch for its consistency.

To get a deeper understanding about the approach, we suggest reading the paper Statistical stability indices for LIME: obtaining reliable explanations for Machine Learning models [1].

 

[1] Visani, Giorgio, et al. "Statistical stability indices for LIME: obtaining reliable explanations for Machine Learning models." arXiv preprint arXiv:2001.11757 (2020).

Installation

Installing through pip package manager:

pip install lime-stability

Prerequisites

List of dependencies:

  • lime
  • statsmodels
  • sklearn
  • numpy

Types of data to use the indices on

The stability indices in lime_stability are currently available only for tabular data (LimeTabularExplainer class). Although the theory behind the indices allow for their usage also with other types of data, but the implementation is not available yet.

Authors

Acknowldegments

We would like to thank CRIF S.p.A. and Università degli Studi di Bologna, which financially supported the project.

Metadata

Release files for lime-stability 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lime-stability 0.1.1
File Size Uploaded Provenance Actions
lime_stability-0.1.1.tar.gz 11.8 kB Without provenance Details for lime_stability-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lime-stability 0.1.1
File Interpreter ABI Platform Actions
lime_stability-0.1.1-py3-none-any.whl Python 3 none any Details for lime_stability-0.1.1-py3-none-any.whl

Total release size: 24.2 kB

Release files / lime_stability-0.1.1.tar.gz

Download URL lime_stability-0.1.1.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
30bd369473de561af39790d4c51b421da72876630eebff560471ae82eb4d5821
BLAKE2b-256 checksum
How to use checksums
a054149ccc9bba31ebef406b9bcf23713ed9ddccb423b88ac619c1d25a126f44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.10

Release files / lime_stability-0.1.1-py3-none-any.whl

Download URL lime_stability-0.1.1-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
667bf8df3ead774040ecf83d528f085fb9b4d28d0b5e795b2ba36c1c2b2b4cf2
BLAKE2b-256 checksum
How to use checksums
cfa251304ec3851c604dba2af8bb3b2e7752cd1daf316861464796e3aec44723
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200325 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.4

Security for lime-stability 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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