Fast slice finding for Machine Learning model debugging.
Project description
Sliceline is a Python library for fast slice finding for Machine Learning model debugging.
It is an implementation of SliceLine: Fast, Linear-Algebra-based Slice Finding for ML Model Debugging, from Svetlana Sagadeeva and Matthias Boehm of Graz University of Technology.
👉 Getting started
Given an input dataset X and a model error vector errors, SliceLine finds the top slices in X that identify where a ML model performs significantly worse.
You can use sliceline as follows:
from sliceline.slicefinder import Slicefinder
slice_finder = Slicefinder()
slice_finder.fit(X, errors)
print(slice_finder.top_slices_)
X_trans = slice_finder.transform(X)
We invite you to check the demo notebooks for a more thorough tutorial:
Implementing Sliceline on Titanic dataset
Implementing Sliceline on California housing dataset
🛠 Installation
Sliceline is intended to work with Python 3.10 or above. Installation can be done with pip:
pip install sliceline
There are wheels available for Linux, MacOS, and Windows, which means that you most probably won’t have to build Sliceline from source.
You can install the latest development version from GitHub as so:
pip install git+https://github.com/DataDome/sliceline --upgrade
Or, through SSH:
pip install git+ssh://git@github.com/datadome/sliceline.git --upgrade
⚡ Performance Optimization
Sliceline includes optional Numba JIT compilation for 5-50x performance improvements on scoring operations.
Quick Installation:
# With optimization support
pip install sliceline[optimized]
Benefits:
5-6x faster scoring operations
1.4-4.5x faster overall fit() performance
Up to 17% memory reduction on large datasets
Automatic fallback to pure NumPy if Numba not available
System Requirements:
Numba requires LLVM to be installed:
# macOS
brew install llvm
# Linux (Ubuntu/Debian)
sudo apt-get install llvm
Verify Optimization:
from sliceline import is_numba_available
print("Numba available:", is_numba_available())
See the performance benchmarks for detailed metrics.
🔗 Useful links
👐 Contributing
Feel free to contribute in any way you like, we’re always open to new ideas and approaches.
Open a discussion if you have any question or enquiry whatsoever. It’s more useful to ask your question in public rather than sending us a private email. It’s also encouraged to open a discussion before contributing, so that everyone is aligned and unnecessary work is avoided.
Feel welcome to open an issue if you think you’ve spotted a bug or a performance issue.
Please check out the contribution guidelines if you want to bring modifications to the code base.
📝 License
Sliceline is free and open-source software licensed under the 3-clause BSD license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sliceline-0.3.0.tar.gz.
File metadata
- Download URL: sliceline-0.3.0.tar.gz
- Upload date:
- Size: 64.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff2727aaa836c8ef7da71a5cd3b951e6bcb42719b1778c0240f1db25d26c28cc
|
|
| MD5 |
a38f6efa66fc1af90196e6e0c815eba0
|
|
| BLAKE2b-256 |
032e50d3fe7298bbf4d4d2a9612f10c7f3b02db0ad5ac410907ccba6c007e6c5
|
Provenance
The following attestation bundles were made for sliceline-0.3.0.tar.gz:
Publisher:
release.yml on DataDome/sliceline
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sliceline-0.3.0.tar.gz -
Subject digest:
ff2727aaa836c8ef7da71a5cd3b951e6bcb42719b1778c0240f1db25d26c28cc - Sigstore transparency entry: 909187483
- Sigstore integration time:
-
Permalink:
DataDome/sliceline@d2aa13b6bdbe1e9b26f9c6719c1070476fbe1b8c -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/DataDome
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d2aa13b6bdbe1e9b26f9c6719c1070476fbe1b8c -
Trigger Event:
release
-
Statement type:
File details
Details for the file sliceline-0.3.0-py3-none-any.whl.
File metadata
- Download URL: sliceline-0.3.0-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0459565e813f3ff8854282666475116f9f2de6d13e881c2f2e360cc212972b25
|
|
| MD5 |
5b311666a37051a47cf320f992516fec
|
|
| BLAKE2b-256 |
87d4bb58b704048e6f3d9ca4a96509ea26efff0d843c6ddff53565a2b74b8d1f
|
Provenance
The following attestation bundles were made for sliceline-0.3.0-py3-none-any.whl:
Publisher:
release.yml on DataDome/sliceline
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sliceline-0.3.0-py3-none-any.whl -
Subject digest:
0459565e813f3ff8854282666475116f9f2de6d13e881c2f2e360cc212972b25 - Sigstore transparency entry: 909187493
- Sigstore integration time:
-
Permalink:
DataDome/sliceline@d2aa13b6bdbe1e9b26f9c6719c1070476fbe1b8c -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/DataDome
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d2aa13b6bdbe1e9b26f9c6719c1070476fbe1b8c -
Trigger Event:
release
-
Statement type: