Releases: shap/shap
v0.45.0
This is a fairly significant release containing a number of breaking changes.
Thank you to a number of new contributors for their contributions to this release! We are eager to grow the pool of maintainers, so please do get in touch on #3559 if you are interested in being part of the team.
What's Changed
Breaking changes
- Dropped support for 3.8 in #3414
- Changed type and shape of returned SHAP values in some cases, to be consistent with model outputs. SHAP values for models with multiple outputs are now np.ndarray rather than list, by @CloseChoice in #3318
- Removed deprecated
feature_dependence
parameters in TreeExplainer and LinearExplainer by @thatlittleboy in #3340 - Removed deprecated alias for Coefficient by @connortann in #3511
Added
- Added support for python 3.12 by @connortann in #3414
- Added support for GPU build on recent CUDA versions by @trivialfis in #3462
- 2x import time speedup via lazy importing of pytorch by @connortann in #3533
- Added support returning the matplotlib figure in bar plots by @richarddli in #3494
- Added selu activation for tensorflow deep explainer by @CloseChoice in #3504
- Added support for special characters in catboost models by @CloseChoice in #3506
- Added ability to control marker size in
beeswarm
plots by @MonoHue in #3530
Fixed
- Fixed XGBoost model load by @trivialfis in #3462
- Fixed text masking with certain tokenizers by @costrau in #3536
- Fixed issue with KernelExplainer when explaining tensorflow models by @connortann in #3542
- Fixed force_plot contribution threshold for negative contributions by @connortann in #3547
- Removed overwrite of default warning filter or formatter by @connortann in #3514
.. plus a large number of documentation, testing and other maintenance updates by @CloseChoice , @yuanx749 , @LakshmanKishore and others.
New Contributors
- @richarddli made their first contribution in #3494
- @yuanx749 made their first contribution in #3458
- @LakshmanKishore made their first contribution in #3393
- @trivialfis made their first contribution in #3462
- @DanGolding made their first contribution in #3526
- @MonoHue made their first contribution in #3530
- @costrau made their first contribution in #3536
Full Changelog: v0.44.1...v0.45.0
v0.44.1
Patch release to fix an issue with the display of force plots.
Fixed
- Fixed HTML issue affecting display of force plots by @CloseChoice in #3464
- Fixed calculation of interactions values for catboost regressors by @CloseChoice in #3459
- Update XGBoost parsing to use ubjson format, replacing deprecated binary format by @CloseChoice in #3345
Other
- Further improvements to documentation
Full Changelog: v0.44.0...v0.44.1
v0.44.0
This release contains a number enhancements and bug fixes.
What's Changed
Added
- Faster and more stable linear solver in KernelShap by @lorentzenchr in #3271
- Enabled passing of
ax
togroup_difference()
plot by @mtlulka in #3355 - Added support for Explanation.display_data in bar plot by @fountaindive in #3386
- Improved build messages when building from source by @connortann in #3403
Fixed
- Fixed
CatboostClassifier
explanations with feature interactions on Windows by @CloseChoice in #3325 - Fixed passing of Xgboost model parameters to xgboost.DMatrix by @vancromy in #3314
- Explicit specification of xgboost>=1.4 constraint by @mtlulka in #3352
- Fixed conversion of DMatrix to CSR matrix by @thatlittleboy in #3359
- Removed deprecated
use_line_collection
independence_plot
by @CloseChoice in #3369 - Fixed bug relating to array reshaping in
scatter
plots by @SomeUserName1 in #2799
Documentation
- A large number of example notebooks fixed and updated by @connortann, @znacer , @thatlittleboy, @CloseChoice and @stompsjo
New Contributors
- @vancromy made their first contribution in #3314
- @lorentzenchr made their first contribution in #3271
- @mtlulka made their first contribution in #3352
- @fountaindive made their first contribution in #3386
- @SomeUserName1 made their first contribution in #2799
- @stompsjo made their first contribution in #3391
Full Changelog: v0.43.0...V0.44.0
v0.43.0
What's Changed
This release contains a number of bug fixes and improvements.
Following the NEP 29 deprecation policy, this release drops support for python 3.7.
Breaking changes
- Removed the deprecated Boston dataset by @thatlittleboy in #3316
- The shape of
Explanation.base_values
has been standardised between different TreeExplainer models to always be of shape(N,)
and not(N,1)
. By @thatlittleboy in #3121
Added
- Added additivity check to Pytorch DeepExplainer (activated by default) by @noxthot in #3265
- Added flag to allow the printing of the mean SHAP value in the legend of a multi-output bar plot. By @101AlexMartin in #3062
- Added heatmap and violin plot to top-level API by @connortann in #3157
- Replaced all tqdm imports with tqdm.auto by @owenlamont in #3199
Fixed
- Fixed segmentation faults on MacOS with lightgbm tests (with newer libomp versions) by @thatlittleboy in #3093
- Support LightGBM ensemble containing single leaf trees (stump) by @thatlittleboy in #3094
- Fixed conversion DataFrame to ndarray for Explanation.data by @danieleongari in #3131
- Fixed waterfall plot on explanations of sklearn tree models by @connortann in #3138
- Fixed pandas input for gradient explainer by @Koen-Git in #3153
- Fixed slicing of
feature_names
in Explanation objects with square.values
by @thatlittleboy in #3126 - Correct xlim in force_matplotlib in cases where the signs of force are all the same by @zaburo-ch in #2839
- Fixed ngboost explanations when col_sample < 1 by @CloseChoice in #3294
- Fixed torch additivity check in PyTorch DeepExplainer by @noxthot in #3281
- Replaced print statements with warnings in DeepExplainer by @znacer in #3264
- Replace deprecated
register_backward_hook()
by @noxthot in #3259 - Fixed deprecated use of xgboost early_stopping_rounds by @CloseChoice in #3306
- Fixed 3rd party deprecation warnings: numba, xgboost, typing, distutils by @connortann in #3084
- Updated the Javascript bundle to update deprecated dependencies by @connortann in #2974
There have also been a large number of improvements to the tutorials and examples, by @connortann, @znacer, @arshiaar, @thatlittleboy, @dsgibbons, @owenlamont and @CloseChoice
New Contributors
- @101AlexMartin made their first contribution in #3062
- @znacer made their first contribution in #3112
- @danieleongari made their first contribution in #3131
- @Koen-Git made their first contribution in #3153
- @pre-commit-ci made their first contribution in #3173
- @owenlamont made their first contribution in #3199
- @arshiaar made their first contribution in #3201
- @dsgibbons made their first contribution in #3200
- @noxthot made their first contribution in #3265
- @zaburo-ch made their first contribution in #2839
- @CloseChoice made their first contribution in #3282
Full Changelog: v0.42.1...v0.43.0
v0.42.1
Patch release to provide wheels for a broader range of architectures.
Added
- Added wheels for linux:aarch64 and macos:arm64 by @PrimozGodec in #3078 and @connortann in #3083.
Fixed
- Fixed circular import issues with shap.benchmark by @thatlittleboy in #3076.
- Fixed TestPyPI releases workflow by @connortann in #3068
- Fix further flaky tests by @thatlittleboy in #3073
- Fix shap.summary_plot to work with matplotlib 3.6.0 by @jklaise in #2697
- Fix benchmark top-level import by @thatlittleboy in #3076
- Fix ipython import warning from top-level shap import by @connortann in #3090
Full Changelog: v0.42.0...v0.42.1
v0.42.0
This release incorporates many changes that were originally contributed by the SHAP community via @dsgibbons's Community Fork, which has now been merged into the main shap repository. PRs from this origin are labelled here as fork#123
.
This will be the last release that supports python 3.7.
Added
- Added support for python 3.11 (fork#72 by @connortann).
- Added
n_points
parameter to all functions inshap.datasets
(fork#39 by @thatlittleboy). - Added
__call__
toKernelExplainer
(#2966 by @dwolfeu). - Added contributing guidelines (#2996 by @connortann).
Fixed
- Fixed
plot.waterfall
to support yticklabels with boolean features (fork#58 by @dwolfeu). - Prevent
TreeExplainer.__call__
from throwing ValueError when passed a pandas DataFrame containing Categorical columns (fork#88 by @thatlittleboy). - Fixed sampling in
shap.datasets
to sample without replacement (fork#36 by @thatlittleboy). - Fixed an
UnboundLocalError
problem arising from passing a dictionary input toshap.plots.bar
(#3001 by @thatlittleboy). - Fixed tensorflow import issue with Pyspark when using
Gradient
(#2983 by @skamdar). - Fixed the aspect ratio of the colorbar in
shap.plots.heatmap
, and use theax
matplotlib API internally for plotting (#3040 by @thatlittleboy). - Fixed deprecation warnings for
numba>=0.44
(fork#9 and fork#68 by @connortann). - Fixed deprecation warnings for
numpy>=1.24
from numpy types (fork#7 by @dsgibbons). - Fixed deprecation warnings for
Ipython>=8
fromIpython.core.display
(fork#13 by @thatlittleboy). - Fixed deprecation warnings for
tensorflow>=2.11
fromtf.optimisers
(fork#16 by @simonangerbauer). - Fixed deprecation warnings for
sklearn>=1.2
fromsklearn.linear_model
(fork#22 by @dsgibbons). - Fixed deprecation warnings for
xgboost>=1.4
fromntree_limit
in tree explainer (#2987 by @adnene-guessoum). - Fixed build on Windows and MacOS (#3015 by @PrimozGodec; #3028, #3029 and #3031 by @connortann).
- Fixed creation of ragged arrays in
shap.explainers.Exact
(#3064 by @connortann).
Changed
- Updates to docstrings of several
shap.plots
functions (#3003, #3005 by @thatlittleboy).
Removed
- Deprecated the Boston house price dataset (fork#38 by @thatlittleboy).
- Removed the unused
mimic.py
file andMimicExplainer
code (fork#53 by @thatlittleboy).
Maintenance
- Fixed failing unit tests (fork#29 by @dsgibbons, fork#20 by @simonangerbauer, #3044 and fork#24 by @connortann).
- Include CUDA GPU C extension files in the source distribution (#3009 by @jklaise).
- Fixed installation of package via setuptools (fork#51 by @thatlittleboy).
- Introduced a minimal set of
ruff
linting (fork#25, fork#26, fork#27, #2973, #2972 and #2976 by @connortann; #2968, #2986 by @thatlittleboy). - Updated project metadata to PEP 517 (#3022 by @connortann).
- Introduced more thorough testing on CI against newer dependencies (fork#61 and #3017 by @connortann)
- Reduced unit test time by ~5 mins (#3046 by @connortann).
- Introduced fixtures for reproducible fuzz testing (#3048 by @connortann).
v0.41.0
Lots of bugs fixes and API improvements.
- Fixed rare bug with XGBoost model loading by @TheZL @lrjball
- Fixed the beeswarm plot so it does not modify the passed explanation object, @ravwojdyla
- Automatic wheel building using GH actions by @quantumtec
- GC collection for memory in KernelExplainer by @Qingtian-Zou
- Fixed max_evals params for PartitionExplainer
- JIT optimize the PartitionExplainer
- Fix colorbar formatting issues @SleepyPepperHead
- New benchmark notebooks
- Use display_data for plotting when possible @yuuuxt
- Improved GPUTreeShap compilation and params @RAMitchell
- Fix TF API change in DeepExplainer @filusn
- Add torch tensor support for plots @alexander-pv
- Switch to Github actions for testing instead of Travis
- New California demo dataset @swalsh1123
- Fix waterfall plot bug @RichardScottOZ
- Handle missing matplotlib installation @klieret
- Add linearize link support for Additive explainer (Nandish Gupta)
- Fix exceptions to be more specific @alexisdrakopoulos @collinb9
- Add color map option for plotting @tlabarta
- Release fixed numpy version requirement @rmehyde
- And many other contributions kindly made by @WeichenXu123 @imatiach-msft @zeshengli @nkthiebaut @songololo @GiovannaNicora @joshzwiebel @Ashishbodla @navdeep-G @smathewmanuel @ycouble @anubhavmaity @adityasaini70 @ngupta20 @jckkvs @abs428 @JulesCollenne @Tiagosf00 @javirandor and @Thuener
v0.40.0
This release contains many bugs fixes and lots of new functionality, specifically for transformer based NLP models. Some highlights include:
- New plots, bug fixes, docs, and features for NLP model explanations (see docs for details).
- important permutation explainer performance fix by @sander-sn
- New joint scatter plots to plot many at once on the same y-scale
- better tree model memory usage by @morriskurz
- new docs by @coryroyce
- new wheel building by @PrimozGodec
- dark mode improvements for the docs by @gialmisi
- api tweaks by @c56pony @nsorros @jebarb