Skip to main content

PyPI Documentation Tests Licence: MIT Code style: black Binder DOI

SLISEMAP: Combine supervised dimensionality reduction with local explanations

SLISEMAP is a supervised dimensionality reduction method, that takes data, in the form of vectors, and predictions from a "black box" regression or classification model as input. SLISEMAP then simultaneously finds local explanations for all data items and builds a (typically) two-dimensional global visualisation of the black box model such that data items with similar local explanations are projected nearby. The explanations consists of interpretable models that locally approximate the "black box" model.

SLISEMAP is implemented in Python using PyTorch for efficient optimisation, and optional GPU-acceleration. For more information see the papers, the examples, or the documentation.

This library also includes the faster SLIPMAP variant, that uses "prototypes" to speed up the calculations (linear time and memory complexity instead of quadratic). SLIPMAP is largely compatible with SLISEMAP, just change the class name (Slisemap to Slipmap, see example below).

Citations

The new SLIPMAP paper (supplements and slides):

Björklund, A., Seppäläinen, L., & Puolamäki, K. (2024).
SLIPMAP: Fast and Robust Manifold Visualisation for Explainable AI
Advances in Intelligent Data Analysis XXII, IDA 2024, pp. 223-235. Lecture Notes in Computer Science, vol 14642. DOI: 10.1007/978-3-031-58553-1_18

The full SLISEMAP paper (arXiv, supplements, and slides):

Björklund, A., Mäkelä, J., & Puolamäki, K. (2023).
SLISEMAP: Supervised dimensionality reduction through local explanations.
Machine Learning 112, 1-43. DOI: 10.1007/s10994-022-06261-1

The short demo paper (video and slides):

Björklund, A., Mäkelä, J., & Puolamäki, K. (2023).
SLISEMAP: Combining Supervised Dimensionality Reduction with Local Explanations.
Machine Learning and Knowledge Discovery in Databases, ECML PKDD 2022. Lecture Notes in Computer Science, vol 13718. DOI: 10.1007/978-3-031-26422-1_41.

Installation

To install the package just run:

pip install slisemap

Or install the latest version directly from GitHub:

pip install git+https://github.com/edahelsinki/slisemap

To use the built-in hyperparameter tuning you also need scikit-optimize, which is automatically installed if you do:

pip install slisemap[tuning]

PyTorch

Since SLISEMAP utilises PyTorch for efficient calculations, you might want to install a version that is optimised for your hardware. See https://pytorch.org/get-started/locally for details.

Example

import numpy as np
from slisemap import Slisemap

X = np.array(...)
y = np.array(...)
sm = Slisemap(X, y, radius=3.5, lasso=0.01)
sm.optimise()
sm.plot(clusters=5, bars=5)

Example plot of the results from using SLISEMAP on the Auto MPG dataset

To use the faster SLIPMAP variant just replace the relevant lines:

from slisemap import Slipmap
sm = Slipmap(X, y, radius=2.0, lasso=0.01)

See the examples for more detailed examples, and the documentation for more detailed instructions.

Release files for slisemap 1.6.2

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

Source distribution (sdist)

Source distribution for slisemap 1.6.2
File Size Uploaded
slisemap-1.6.2.tar.gz 69.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for slisemap 1.6.2
File Interpreter ABI Platform
slisemap-1.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 132.8 kB

Release files / slisemap-1.6.2.tar.gz

Download URL slisemap-1.6.2.tar.gz
Size 69.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3d16e772ac3b5f75e427e802edd3443e116f87075523184578418386eea39b46
BLAKE2b-256 checksum
How to use checksums
a5214e946f31e94af3f7ef5ddf41d1e2ebd83ee65126a66220be8da8f1efb090
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / slisemap-1.6.2-py3-none-any.whl

Download URL slisemap-1.6.2-py3-none-any.whl
Size 63.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16cd857fcf2ec96e2501659939adae510c2af26197215fa4e9f17a0b94f1bc4a
BLAKE2b-256 checksum
How to use checksums
e42093a07039fa29d743a3f3c2a6c0e85bbae352a156ca83e2b103c466d12158
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.6.2 This release

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0

2 release files

0.2

2 release files

0.1

2 release 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