Skip to content

Commit d0adb18

Browse files
authored
Merge pull request #5 from edahelsinki/docs
Badges
2 parents 86ab92f + 7130909 commit d0adb18

File tree

9 files changed

+37
-8
lines changed

9 files changed

+37
-8
lines changed

.github/workflows/python-docs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# This workflow will build the documentation using mkdocs and push it to the gh-pages branch when a release is created
22
# For more information see: https://www.mkdocs.org/user-guide/deploying-your-docs/
33

4-
name: Build documentation
4+
name: docs
5+
56
on:
67
workflow_dispatch:
78
release:
89
branches: [master, main]
910
types: [released]
11+
1012
jobs:
1113
deploy:
1214
runs-on: ubuntu-latest
@@ -15,9 +17,11 @@ jobs:
1517
- uses: actions/setup-python@v2
1618
with:
1719
python-version: 3.x
20+
1821
- name: Install dependencies
1922
run: |
2023
python -m pip install --upgrade pip
2124
python -m pip install -r docs/requirements-dev.txt
25+
2226
- name: Build and deploy
2327
run: mkdocs gh-deploy --force --clean --verbose

.github/workflows/python-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# separate terms of service, privacy policy, and support
77
# documentation.
88

9-
name: Upload Python Package
9+
name: publish
1010

1111
on:
1212
release:

.github/workflows/python-pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: Test Python Package
4+
name: tests
55

66
on:
77
push:

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
![PySLISE Banner Image](docs/pyslise_banner.webp)
1+
![PySLISE Banner Image](docs/pyslise_banner.webp)
2+
[![PyPI](https://img.shields.io/pypi/v/slise)](https://pypi.org/project/slise/)
3+
[![Documentation](https://github.com/edahelsinki/pyslise/actions/workflows/python-docs.yml/badge.svg)](https://edahelsinki.github.io/pyslise/docs/slise/)
4+
[![Tests](https://github.com/edahelsinki/pyslise/actions/workflows/python-pytest.yml/badge.svg)](https://github.com/edahelsinki/pyslise/actions/workflows/python-pytest.yml)
5+
[![GitHub license](https://img.shields.io/github/license/edahelsinki/pyslise)](https://github.com/edahelsinki/pyslise/blob/master/LICENSE)
6+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/edahelsinki/pyslise/HEAD?labpath=examples)
7+
28
# SLISE - Sparse Linear Subset Explanations
39

410
Python implementation of the SLISE algorithm. The SLISE algorithm can be used for both robust regression and to explain outcomes from black box models.
5-
For more details see [the original paper](https://rdcu.be/bVbda) or the [robust regression paper](https://rdcu.be/cFRHD).
11+
For more details see [the original paper](https://rdcu.be/bVbda) or [the robust regression paper](https://rdcu.be/cFRHD).
612
Alternatively for a more informal overview see [the presentation](https://github.com/edahelsinki/slise/raw/master/vignettes/presentation.pdf), or [the poster](https://github.com/edahelsinki/slise/raw/master/vignettes/poster.pdf).
13+
Finally, for learning to use the python package there are several [examples](https://github.com/edahelsinki/pyslise/tree/master/examples/) and [the documentation](https://edahelsinki.github.io/pyslise/docs/slise/).
714

815
> *Björklund A., Henelius A., Oikarinen E., Kallonen K., Puolamäki K.* (2019)
916
> **Sparse Robust Regression for Explaining Classifiers.**

examples/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Examples
2+
3+
This directory contains jupyter notebooks that demonstrate how to use SLISE.
4+
The first notebook focuses on how to use SLISE for robust regression and why robust regression can be advantageous over normal linear regression.
5+
The following notebooks demonstrates how SLISE can be used to explain outcomes from black box models on various datasets.
6+
7+
The notebooks can be viewed directly on GitHub by opening them. But they can also be viewed interactively through binder: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/edahelsinki/pyslise/HEAD?labpath=examples) (note that the binder instances tend to be quite slow).

examples/requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
tensorflow
2+
wordcloud
3+
nltk
4+
slise
5+
tbb
6+
icc_rt

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ theme:
88
icon:
99
logo: material/book-open
1010
favicon: pyslise_icon.webp
11+
font: false
1112
palette:
1213
- media: "(prefers-color-scheme: light)"
1314
scheme: default

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = slise
3-
version = 2.1.2
3+
version = 2.1.3
44
author = Anton Björklund
55
author_email = anton.bjorklund@helsinki.fi
66
description = The SLISE algorithm for robust regression and explanations of black box models

slise/initialisation.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def initialise_candidates(
199199
beta_max: float = 20,
200200
max_approx: float = 1.15,
201201
pca_treshold: int = 10,
202-
num_init: int = 500,
202+
num_init: Optional[int] = None,
203203
max_iterations: int = 300,
204204
beta_max_init: float = 2.5,
205205
min_beta_step: float = 1e-8,
@@ -224,6 +224,8 @@ def initialise_candidates(
224224
Returns:
225225
Tuple[np.ndarray, float]: `(alpha, beta)`.
226226
"""
227+
if num_init is None:
228+
num_init = min(500, 3 * 4 ** X.shape[1])
227229
# Prepare parameters
228230
epsilon = epsilon**2
229231
beta_max = min(beta_max, beta_max_init) / epsilon
@@ -273,7 +275,7 @@ def initialise_candidates2(
273275
weight: Optional[np.ndarray] = None,
274276
beta_max: float = 20,
275277
max_approx: float = 1.15,
276-
num_init: int = 500,
278+
num_init: Optional[int] = None,
277279
max_iterations: int = 300,
278280
beta_max_init: float = 2.5,
279281
min_beta_step: float = 1e-8,
@@ -297,6 +299,8 @@ def initialise_candidates2(
297299
Returns:
298300
Tuple[np.ndarray, float]: `(alpha, beta)`.
299301
"""
302+
if num_init is None:
303+
num_init = min(500, 3 * 4 ** X.shape[1])
300304
# Prepare parameters
301305
epsilon = epsilon**2
302306
beta_max = min(beta_max, beta_max_init) / epsilon

0 commit comments

Comments
 (0)