Skip to content

Commit 3d81fe6

Browse files
Anton BjörklundAggrathon
Anton Björklund
authored andcommitted
Add PyPI installation instructions
1 parent 1bf03b6 commit 3d81fe6

5 files changed

+32
-28
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,18 @@ SLISE can also be used to provide *local model-agnostic explanations* for outcom
2222
## Installation
2323

2424
To install this package just run:
25+
26+
```sh
27+
pip install slise
28+
```
29+
30+
Or install the latest version directly from GitHub with:
31+
2532
```sh
2633
pip install https://github.com/edahelsinki/pyslise
2734
```
28-
Alternatively you can download the repo and run `python -m build` to build a wheel or `pip install .` to install locally.
35+
36+
Alternatively you can download the repo and run `python -m build` to build a wheel, or `pip install .` to install it locally.
2937

3038
### Other Languages
3139

examples/0_robust_regression.ipynb

+3-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@
3434
"source": [
3535
"## Prerequisites\n",
3636
"\n",
37-
"The examples in this notebook assumes that SLISE is installed, which can be done with:\n",
38-
"```sh\n",
39-
"pip install https://github.com/edahelsinki/pyslise\n",
40-
"```"
37+
"- SLISE (for explanations)\n",
38+
"- NumPy (for numerical operations)\n",
39+
"- Matplotlib (for plots)"
4140
],
4241
"cell_type": "markdown",
4342
"metadata": {}

examples/1_tabular_explanation.ipynb

+7-8
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@
3737
"source": [
3838
"## Prerequisites\n",
3939
"\n",
40-
"The example in this notebook assumes that SLISE is installed, which can be done with:\n",
41-
"```sh\n",
42-
"pip install https://github.com/edahelsinki/pyslise\n",
43-
"```\n",
44-
"We also need Keras (Tensorflow) for the neural network:"
40+
"- SLISE (for explanations)\n",
41+
"- NumPy (for numerical operations)\n",
42+
"- Matplotlib (for plots)\n",
43+
"- TensorFlow (for the neural network and data loading)"
4544
],
4645
"cell_type": "markdown",
4746
"metadata": {}
@@ -52,10 +51,10 @@
5251
"metadata": {},
5352
"outputs": [],
5453
"source": [
55-
"import numpy as np\n",
56-
"from tensorflow import keras\n",
5754
"import slise\n",
58-
"from matplotlib import pyplot as plt"
55+
"import numpy as np\n",
56+
"from matplotlib import pyplot as plt\n",
57+
"from tensorflow import keras"
5958
]
6059
},
6160
{

examples/2_imbd_explanation.ipynb

+7-7
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
"## Prerequisites\n",
3737
"\n",
3838
"- SLISE (for explanations)\n",
39-
"- numpy (for numerical operations)\n",
40-
"- matplotlib (for plots)\n",
41-
"- wordcloud (for plots)\n",
42-
"- nltk (for text pre-processing)\n",
43-
"- tensorflow (for keras, neural networks, and data loading)"
39+
"- NumPy (for numerical operations)\n",
40+
"- Matplotlib (for plots)\n",
41+
"- WordCloud (for plots)\n",
42+
"- Natural Language Toolkit (for text pre-processing)\n",
43+
"- TensorFlow (for the neural network and data loading)"
4444
],
4545
"cell_type": "markdown",
4646
"metadata": {}
@@ -51,15 +51,15 @@
5151
"metadata": {},
5252
"outputs": [],
5353
"source": [
54-
"import numpy as np\n",
55-
"from tensorflow import keras\n",
5654
"import slise\n",
5755
"from slise.plot import SLISE_COLORMAP, SLISE_ORANGE, SLISE_PURPLE\n",
56+
"import numpy as np\n",
5857
"from matplotlib import pyplot as plt\n",
5958
"from matplotlib.patches import Patch\n",
6059
"from wordcloud import WordCloud\n",
6160
"from nltk import PorterStemmer, download as nltk_download\n",
6261
"from nltk.corpus import stopwords\n",
62+
"from tensorflow import keras\n",
6363
"\n",
6464
"plt.rcParams['figure.figsize'] = [10, 6]\n",
6565
"try:\n",

examples/3_mnist_explanation.ipynb

+6-8
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,10 @@
4343
"source": [
4444
"## Prerequisites\n",
4545
"\n",
46-
"The example in this notebook assumes that SLISE is installed, which can be done with:\n",
47-
"```sh\n",
48-
"pip install https://github.com/edahelsinki/pyslise\n",
49-
"```\n",
50-
"We also need Keras (Tensorflow) for the neural network (and data):"
46+
"- SLISE (for explanations)\n",
47+
"- NumPy (for numerical operations)\n",
48+
"- Matplotlib (for plots)\n",
49+
"- TensorFlow (for the neural network and data loading)"
5150
],
5251
"cell_type": "markdown",
5352
"metadata": {}
@@ -58,12 +57,11 @@
5857
"metadata": {},
5958
"outputs": [],
6059
"source": [
61-
"import numpy as np\n",
62-
"from tensorflow import keras\n",
6360
"import slise\n",
6461
"from slise.plot import BW_COLORMAP\n",
62+
"import numpy as np\n",
6563
"from matplotlib import pyplot as plt\n",
66-
"from scipy.stats import gaussian_kde\n",
64+
"from tensorflow import keras\n",
6765
"\n",
6866
"plt.rcParams['figure.figsize'] = [10, 6]"
6967
]

0 commit comments

Comments
 (0)