Skip to content

CRAN release 0.9.0

Latest

Choose a tag to compare

@mayer79 mayer79 released this 25 Jul 13:10
· 8 commits to main since this release
d86ab1e

Bug fix

With input from Mario Wuethrich and Ian Covert and his repo,
we have fixed a bug in how kernelshap() calculates Kernel weights.

  • The differences caused by this are typically very small.
  • Models with interactions of order up to two have been unaffected.
  • Exact Kernel SHAP now provides identical results to exact permutation SHAP.

Fixed in #168, which also has received
unit tests against Python's "shap".

API

  • The argument feature_names can now also be used with matrix input (#166).
  • kernelshap() and permshap() have received a seed = NULL argument (#170).
  • Parallel mode: If missing packages or globals have to be specified, this now has to be done through parallel_args = list(packages = ..., globals = ...)
    instead of parallel_args = list(.packages = ..., .globals = ...), see section on parallelism below.
    The list is passed to [foreach::foreach(.options.future = ...)].

Speed and memory improvements

  • permshap() and kernelshap() require about 10% less memory (#166).
  • permshap() and kernelshap() are faster for data.frame input,
    and slightly slower for matrix input (#166).
  • Additionally, permshap(, exact = TRUE) is faster by pre-calculating more
    elements used across rows (#165).

Internal changes

  • Matrices holding on-off vectors are now consistently of type logical (#167).
  • kernelshap() solver: Replacing the Moore-Penrose pseudo-inverse by two direct solves, a trick of Ian Covert,
    and ported to R in (#171).

Changes in parallelism

We have switched from %dopar% to doFuture (#170) with the following impact:

  • No need for calling registerDoFuture() anymore.
  • Random seeding is properly handled, and respects seed, thanks #163 for reporting.
  • If missing packages or globals have to be specified, this now has to be done through parallel_args = list(packages = ..., globals = ...)
    instead of parallel_args = list(.packages = ..., .globals = ...). The list is passed to [foreach::foreach(.options.future = ...)].

Dependencies

  • {MASS}: Dropped from imports
  • {doFuture}: suggests -> imports