-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from edahelsinki/select_dists
Select variables when using plot_dist
- Loading branch information
Showing
16 changed files
with
248 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,16 +15,15 @@ jobs: | |
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.x" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package | ||
uses: pypa/[email protected] | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[project] | ||
name = "slise" | ||
version = "2.2.3" | ||
version = "2.2.4" | ||
authors = [{ name = "Anton Björklund", email = "[email protected]" }] | ||
description = "The SLISE algorithm for robust regression and explanations of black box models" | ||
readme = "README.md" | ||
|
@@ -28,7 +28,7 @@ dependencies = [ | |
] | ||
|
||
[project.optional-dependencies] | ||
dev = ["pytest", "black[jupyter]", "pylint", "IPython"] | ||
dev = ["pytest", "pytest-cov", "black[jupyter]", "pylint", "IPython", "ruff"] | ||
tbb = ["tbb"] | ||
|
||
[project.urls] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,53 @@ | ||
""" | ||
SLISE - Sparse Linear Subset Explanations | ||
----------------------------------------- | ||
The SLISE algorithm can be used for both robust regression and to explain outcomes from black box models. | ||
See [slise.slise.regression][] and [slise.slise.explain][] for referense. | ||
In robust regression we fit regression models that can handle data that | ||
contains outliers. 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. 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). | ||
More in-depth details about the algorithm can be found in the papers: | ||
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 | ||
Björklund A., Henelius A., Oikarinen E., Kallonen K., Puolamäki K. | ||
Robust regression via error tolerance. | ||
Data Mining and Knowledge Discovery (2022). | ||
https://doi.org/10.1007/s10618-022-00819-2 | ||
SLISE - Sparse Linear Subset Explanations | ||
----------------------------------------- | ||
The SLISE algorithm can be used for both robust regression and to explain outcomes from black box models. | ||
See [slise.slise.regression][] and [slise.slise.explain][] for referense. | ||
In robust regression we fit regression models that can handle data that | ||
contains outliers. 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. 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). | ||
More in-depth details about the algorithm can be found in the papers: | ||
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 | ||
Björklund A., Henelius A., Oikarinen E., Kallonen K., Puolamäki K. | ||
Robust regression via error tolerance. | ||
Data Mining and Knowledge Discovery (2022). | ||
https://doi.org/10.1007/s10618-022-00819-2 | ||
Björklund A., Henelius A., Oikarinen E., Kallonen K., Puolamäki K. | ||
Explaining any black box model using real data. | ||
Frontiers in Computer Science 5:1143904 (2023). | ||
https://doi.org/10.3389/fcomp.2023.1143904 | ||
""" | ||
|
||
from slise.slise import ( | ||
from slise.slise import ( # noqa: F401 | ||
SliseRegression, | ||
regression, | ||
SliseExplainer, | ||
explain, | ||
SliseWarning, | ||
) | ||
from slise.utils import limited_logit as logit | ||
from slise.data import normalise_robust | ||
from slise.utils import limited_logit as logit # noqa: F401 | ||
from slise.data import normalise_robust # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.