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
+10-22Lines changed: 10 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,39 +1,27 @@
1
-
# kernelshap 0.1.900 DEVEL
1
+
# kernelshap 0.2.0
2
2
3
3
## Breaking change
4
4
5
-
The interface of `kernelshap()` has been revised. Instead of specifying a prediction function, it suffices now to pass the fitted model object. The default `pred_fun` is now `stats::predict`, which works in most cases. Some other cases are catched via model class ("ranger" and mlr3 "Learner"). The `pred_fun` can be overwritten by a function of the form `function(object, X, ...)`.
5
+
The interface of `kernelshap()` has been revised. Instead of specifying a prediction function, it suffices now to pass the fitted model object. The default `pred_fun` is now `stats::predict`, which works in most cases. Some other cases are catched via model class ("ranger" and mlr3 "Learner"). The `pred_fun` can be overwritten by a function of the form `function(object, X, ...)`. Additional arguments to the prediction function are passed via `...` of `kernelshap()`.
6
6
7
-
Example: Logistic regression with predictions on logit scale
7
+
Some examples:
8
8
9
-
```
10
-
kernelshap(fit, X, bg_X)
11
-
```
12
-
13
-
Example: Logistic regression with predictions on probability scale
14
-
15
-
```
16
-
kernelshap(fit, X, bg_X, type = "response")
17
-
```
18
-
19
-
Example: Log-linear regression to be evaluated on original scale.
20
-
Here, the default predict function needs to be overwritten:
- Logistic regression (probabilities): `kernelshap(fit, X, bg_X, type = "response")`
11
+
- Linear regression with logarithmic response, but evaluated on original scale: Here, the default predict function needs to be overwritten: `kernelshap(fit, X, bg_X, pred_fun = function(m, X) exp(predict(m, X)))`
25
12
26
13
## Major improvements
27
14
28
15
-`kernelshap()` has received a more intuitive interface, see breaking change above.
29
16
- The package now supports multidimensional predictions. Hurray!
30
-
- Thanks to David Watson, parallel computing is now supported. The user needs to set up the parallel backend before calling `kernelshap()`, i.e., using the "doFuture" package, and then set `parallel = TRUE`. Especially on Windows, sometimes not all global variables or packages are loaded in the parallel instances. These can be specified by `parallel_args`, a list of arguments passed to `foreach()`.
17
+
- Thanks to David Watson, parallel computing is now supported. The user needs to set up the parallel backend before calling `kernelshap()`, e.g., using the "doFuture" package, and then set `parallel = TRUE`. Especially on Windows, sometimes not all global variables or packages are loaded in the parallel instances. These can be specified by `parallel_args`, a list of arguments passed to `foreach()`.
31
18
- Even without parallel computing, `kernelshap()` has become much faster.
32
19
- For $2 \le p \le 5$ features, the algorithm now returns exact Kernel SHAP values with respect to the given background data. (For $p = 1$, exact *Shapley values* are returned.)
33
-
-Besides `matrix`, `data.frame`s, and `tibble`s, the package now also accepts `data.table`s (if the prediction function can deal with them).
20
+
-Direct handling of "tidymodels" models.
34
21
35
22
## User visible changes
36
23
24
+
- Besides `matrix`, `data.frame`s, and `tibble`s, the package now also accepts `data.table`s (if the prediction function can deal with them).
37
25
-`kernelshap()` is less picky regarding the output structure of `pred_fun()`.
38
26
-`kernelshap()` is less picky about the column structure of the background data `bg_X`. It should simply contain the columns of `X` (but can have more or in different order). The old behaviour was to launch an error if `colnames(X) != colnames(bg_X)`.
39
27
- The default `m = "auto"` has been changed from `trunc(20 * sqrt(p))` to `max(trunc(20 * sqrt(p)), 5 * p`. This will have an effect for cases where the number of features $p > 16$. The change will imply more robust results for large p.
0 commit comments