slise

Robust regression algorithm that can be used for explaining black box models (Python implementation)

https://github.com/edahelsinki/pyslise

Science Score: 31.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 8 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.8%) to scientific vocabulary

Keywords

black-box-explanations explain-classifiers explainable-ai explainable-ml interpretable-machine-learning local-explanations machine-learning model-agnostic python research research-paper robust-regression slise slise-algorithm sparse-regression
Last synced: 6 months ago · JSON representation ·

Repository

Robust regression algorithm that can be used for explaining black box models (Python implementation)

Basic Info
Statistics
  • Stars: 6
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 12
Topics
black-box-explanations explain-classifiers explainable-ai explainable-ml interpretable-machine-learning local-explanations machine-learning model-agnostic python research research-paper robust-regression slise slise-algorithm sparse-regression
Created about 6 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License Citation

README.md

PySLISE Banner Image
PyPI Documentation Tests License: MIT Binder

SLISE - Sparse Linear Subset Explanations

Python implementation of the SLISE algorithm. The SLISE algorithm can be used for both robust regression and to explain outcomes from black box models. For more details see the conference paper, the robust regression paper, or the local explanation paper. Alternatively for a more informal overview see the presentation, or the poster. Finally, for learning to use the python package there are several examples and the documentation.

Björklund A., Henelius A., Oikarinen E., Kallonen K., Puolamäki K. (2019)
Sparse Robust Regression for Explaining Classifiers.
Discovery Science (DS 2019).
Lecture Notes in Computer Science, vol 11828, Springer.
https://doi.org/10.1007/978-3-030-33778-0_27

Björklund A., Henelius A., Oikarinen E., Kallonen K., Puolamäki K. (2022).
Robust regression via error tolerance.
Data Mining and Knowledge Discovery.
https://doi.org/10.1007/s10618-022-00819-2

Björklund A., Henelius A., Oikarinen E., Kallonen K., Puolamäki K. (2023)
Explaining any black box model using real data.
Frontiers in Computer Science 5:1143904.
https://doi.org/10.3389/fcomp.2023.1143904

The idea

In robust regression we fit regression models that can handle data that contains outliers (see the example below for why outliers are problematic for normal regression). SLISE accomplishes this by fitting a model such that the largest possible subset of the data items have an error less than a given value. All items with an error larger than that are considered potential outliers and do not affect the resulting model.

SLISE can also be used to provide local model-agnostic explanations for outcomes from black box models. To do this we replace the ground truth response vector with the predictions from the complex model. Furthermore, we force the model to fit a selected item (making the explanation local). This gives us a local approximation of the complex model with a simpler linear model (this is similar to, e.g., LIME and SHAP). In contrast to other methods SLISE creates explanations using real data (not some discretised and randomly sampled data) so we can be sure that all inputs are valid (i.e. in the correct data manifold, and follows the constraints used to generate the data, e.g., the laws of physics).

Installation

To install this package just run:

sh pip install slise

Or install the latest version directly from GitHub:

sh pip install git+https://github.com/edahelsinki/pyslise

Alternatively you can download the repo and run python -m build to build a wheel, or pip install . to install it locally.

Numba

SLISE uses Numba to speed up the calculations. You might want to install the optional libraries to get the most out of Numba:

sh pip install "slise[tbb]"

Other implementations

The (original) R implementation can be found here.

Examples

Here are two quick examples of SLISE in action. For more detailed examples, with descriptions on how to create and interpret them, see the examples directory.

Example of Robust Regression
SLISE is a robust regression algorithm, which means that it is able to handle outliers. This is in contrast to, e.g., ordinary least-squares regression, which gives skewed results when outliers are present.

 

Example of Explanation
SLISE can also be used to explain outcomes from black box models by locally approximating the complex models with a simpler linear model.

Dependencies

This implementation requires Python 3 and the following packages:

  • matplotlib
  • numba
  • numpy
  • PyLBFGS
  • scipy

Owner

  • Name: EDA Helsinki
  • Login: edahelsinki
  • Kind: organization

The Exploratory Data Analysis group, lead by Associate Professor Kai Puolamäki, is located at University of Helsinki (CS and INAR)

Citation (CITATIONS.bib)

@article{bjorklund2023explaining,
  title   = {Explaining any black box model using real data},
  author  = {Bj{\"o}rklund, Anton and Henelius, Andreas and Oikarinen, Emilia and Kallonen, Kimmo and Puolam{\"a}ki, Kai},
  journal = {Frontiers in Computer Science},
  volume  = {5},
  year    = {2023},
  url     = {https://www.frontiersin.org/articles/10.3389/fcomp.2023.1143904},
  doi     = {10.3389/fcomp.2023.1143904},
  issn    = {2624-9898}
}

@article{bjorklund2022robust,
  title   = {Robust regression via error tolerance},
  author  = {Bj{\"o}rklund, Anton and Henelius, Andreas and Oikarinen, Emilia and Kallonen, Kimmo and Puolam{\"a}ki, Kai},
  year    = {2022},
  month   = jan,
  journal = {Data Mining and Knowledge Discovery},
  issn    = {1384-5810, 1573-756X},
  doi     = {10.1007/s10618-022-00819-2}
}

@inproceedings{bjorklund2019sparse,
  title     = {Sparse Robust Regression for Explaining Classifiers},
  booktitle = {Discovery Science},
  author    = {Bj{\"o}rklund, Anton and Henelius, Andreas and Oikarinen, Emilia and Kallonen, Kimmo and Puolam{\"a}ki, Kai},
  year      = {2019},
  series    = {Lecture Notes in Computer Science},
  volume    = {11828},
  pages     = {351--366},
  publisher = {Springer International Publishing},
  doi       = {10.1007/978-3-030-33778-0_27},
  isbn      = {978-3-030-33777-3 978-3-030-33778-0}
}

GitHub Events

Total
Last Year

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 130
  • Total Committers: 4
  • Avg Commits per committer: 32.5
  • Development Distribution Score (DDS): 0.592
Top Committers
Name Email Commits
Anton Björklund -****l 53
Aggrathon a****o@g****m 41
Anton Björklund a****d@h****i 31
Anton Björklund b****t@h****i 5
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 1
  • Total pull requests: 11
  • Average time to close issues: 3 days
  • Average time to close pull requests: 9 minutes
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 3.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 10
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mdhimes (1)
Pull Request Authors
  • Aggrathon (12)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 123 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 10
  • Total maintainers: 1
pypi.org: slise

The SLISE algorithm for robust regression and explanations of black box models

  • Documentation: https://slise.readthedocs.io/
  • License: MIT License Copyright (c) 2022 Anton Björklund Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 2.2.4
    published almost 2 years ago
  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 123 Last month
Rankings
Dependent packages count: 9.8%
Average: 20.8%
Dependent repos count: 21.8%
Downloads: 30.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

binder/requirements.txt pypi
  • icc_rt *
  • nltk *
  • slise *
  • tbb *
  • tensorflow *
  • wordcloud *
docs/requirements-dev.txt pypi
  • mkdocs * development
  • mkdocs-include-markdown-plugin * development
  • mkdocs-material * development
  • mkdocstrings * development
.github/workflows/python-docs.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/python-publish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • pypa/gh-action-pypi-publish v1.8.5 composite
.github/workflows/python-pytest.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
pyproject.toml pypi
  • PyLBFGS >= 0.2
  • cython < 3.0
  • matplotlib >= 3.3
  • numba >= 0.53
  • numpy >= 1.20
  • scipy >= 1.6