Skip to main content

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

Project description

Example of Robust Regression

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 paper, alternatively for a more informal overview see the presentation, or the poster.

Björklund A., Henelius A., Oikarinen E., Kallonen K., Puolamäki K.
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

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:

pip install 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 locally.

Other Languages

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 Robust Regression
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 is requires Python 3 and the following packages:

  • matplotlib
  • numba
  • numpy
  • PyLBFGS
  • scipy

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slise-1.1.2.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

slise-1.1.2-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file slise-1.1.2.tar.gz.

File metadata

  • Download URL: slise-1.1.2.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for slise-1.1.2.tar.gz
Algorithm Hash digest
SHA256 45f8d7b9aefa7ea6a99bd2fab9d7c9b66339fa38578013b0c883cd7b569142a6
MD5 33933c86ef32ca1643cc9d047b247992
BLAKE2b-256 8bb4452d201a1685c61d3408248f1fc6714263c9a18c2e81a468bff2d8b897ed

See more details on using hashes here.

File details

Details for the file slise-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: slise-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for slise-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 360dd7879e99af9728f211f80dbcd3c9ed23ef5e236b14951d5b461226b653f9
MD5 46e7777757bc05a2d5149c9faa875190
BLAKE2b-256 25fa622a8f230e820a124bedddeb7e62166a686990fe0f0063b5f6c73a65b4ab

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page