You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: NEWS.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,26 @@
1
+
# kernelshap 0.5.0
2
+
3
+
## New features
4
+
5
+
New additive explainer `additive_shap()` that works for models fitted via
6
+
7
+
-`lm()`,
8
+
-`glm()`,
9
+
-`mgcv::gam()`,
10
+
-`mgcv::bam()`,
11
+
-`gam::gam()`,
12
+
-`survival::coxph()`,
13
+
-`survival::survreg()`.
14
+
15
+
The explainer uses `predict(..., type = "terms")`, a beautiful trick
16
+
used in `fastshap::explain.lm()`. The result will be identical to those returned by `kernelshap()` and `permshap()` but exponentially faster. Thanks David Watson for the great idea discussed in [#130](https://github.com/ModelOriented/kernelshap/issues/130).
17
+
18
+
## User visible changes
19
+
20
+
-`permshap()` now returns an object of class "kernelshap" to reduce the number of redundant methods.
21
+
- To distinguish which algorithm has generated the "kernelshap" object, the outputs of `kernelshap()`, `permshap()` (and `additive_shap()`) got an element "algorithm".
Copy file name to clipboardExpand all lines: README.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,11 +13,14 @@
13
13
14
14
## Overview
15
15
16
-
The package contains two workhorses to calculate SHAP values for any model:
16
+
The package contains two workhorses to calculate SHAP values for *any* model:
17
17
18
18
-`permshap()`: Exact permutation SHAP algorithm of [1]. Available for up to $p=14$ features.
19
19
-`kernelshap()`: Kernel SHAP algorithm of [2] and [3]. By default, exact Kernel SHAP is used for up to $p=8$ features, and an almost exact hybrid algorithm otherwise.
20
20
21
+
Furthermore, the function `additive_shap()` produces SHAP values for additive models fitted via `lm()`, `glm()`, `mgcv::gam()`, `mgcv::bam()`, `gam::gam()`,
22
+
`survival::coxph()`, or `survival::survreg()`. It is exponentially faster than `permshap()` and `kernelshap()`, with identical results.
23
+
21
24
### Kernel SHAP or permutation SHAP?
22
25
23
26
Kernel SHAP has been introduced in [2] as an approximation of permutation SHAP [1]. For up to ten features, exact calculations are realistic for both algorithms. Since exact Kernel SHAP is still only an approximation of exact permutation SHAP, the latter should be preferred in this case, even if the results are often very similar.
@@ -38,6 +41,7 @@ If the training data is small, use the full training data. In cases with a natur
38
41
- Factor-valued predictions are automatically turned into one-hot-encoded columns.
39
42
- Case weights are supported via the argument `bg_w`.
40
43
- By changing the defaults in `kernelshap()`, the iterative pure sampling approach in [3] can be enforced.
44
+
- The `additive_shap()` explainer is easier to use: Only the model and `X` are required.
41
45
42
46
## Installation
43
47
@@ -215,6 +219,18 @@ sv_dependence(ps, xvars)
215
219
216
220

217
221
222
+
### Additive SHAP
223
+
224
+
The additive explainer extracts the additive contribution of each feature from a model of suitable class.
0 commit comments