Repository navigation
Releases
0.54.1
SHAP v0.54.1
Highlights
CUDA acceleration with shap-cuda
GPU support now lives in the separate shap-cuda package, providing the CUDA-accelerated backend for shap.GPUTreeExplainer. The GPU wheel workflow builds CUDA-enabled wheels and tests them on AWS GPU runners before publishing. By @CloseChoice in #5140.
The GPU TreeExplainer notebook has also been refreshed by @RAMitchell in #5220.
What's Changed
Enhancements
shap.plots.violinnow accepts anaxargument and returns the axes, making it easier to customize plots and compose subplots. By @adt-kmr in #5218.
Maintenance
- Remove unused global-path-dependent Tree SHAP code. By @RAMitchell in #5223.
Documentation
- Fix typos in the "An introduction to explainable AI" notebook. By @Yaqiao-chi-helen in #5225.
- Fix typos in comments, docstrings, and an error message. By @guptaishaan in #5213.
- Fix typos and replace the deprecated API reference in the LinearExplainer correlation notebook with
maskers.Impute(data). By @ojuschugh1 in #5172.
New Contributors
- @Yaqiao-chi-helen made their first contribution in #5225.
- @guptaishaan made their first contribution in #5213.
- @ojuschugh1 made their first contribution in #5172.
Full Changelog: v0.53.0...v0.54.1
Full Changelog: v0.53.0...v0.54.1
0.53.0
Highlights
- Python 3.15 support: SHAP now builds wheels and runs tests against Python 3.15, including pre-releases. By @CloseChoice in #5143
- Migration away from Numba and llvmlite: core utilities have been migrated to nanobind/C++, allowing Numba and llvmlite to be removed as required dependencies and enabling support for free-threaded Python. By @daidahao and @CloseChoice in #5081, #5082, #5088, #5089, #5090, #5091, #5092, #5117, #5129
- GPU TreeSHAP improvements: LightGBM categorical GPU TreeSHAP support has been added, alongside TreeExplainer changes and CPU/GPU equivalence testing for categorical features. By @RAMitchell and @CloseChoice in #5020 and #5026
- Additional build targets: add Windows ARM64 and Emscripten builds. By @ndabas and @CloseChoice in #5137 and #5162
What's Changed
Breaking changes
- Match KernelExplainer DataFrame columns to the background by name. Duplicated column names now raise an error, but worked previously. By @Atishyy27 in #5164.
Fixes
- Fix int16 overflow of node indices in independent TreeSHAP, which could cause segmentation faults for trees with more than 32,767 nodes. By @clark874 in #5163
- Refactor short circuiting of tree_path_dependent SHAP calculation by @CloseChoice in #5069
- Remove outdated TensorFlow version warnings from DeepExplainer by @SushantTusharJoshi in #5126
Enhancements
- Support LightGBM categorical GPU TreeSHAP by @RAMitchell in #5020
- Use TreeEnsemble directly in TreeExplainer and add CPU/GPU equivalence tests for categorical features by @CloseChoice in #5026
- Add GPU build, packaging, CI, smoke tests, and TestPyPI support by @CloseChoice in #5057, #5058, #5114, #5123, #5127
- Move optional dependencies into dependency groups by @daidahao in #4589
- Add performance monitoring for explainers by @daidahao in #5071
- Remove Numba from the image masker by @daidahao in #5089
- Migrate clustering utilities to nanobind by @daidahao in #5088
- Migrate tabular masking utilities to nanobind by @daidahao in #5090
- Migrate ExactExplainer interaction utility to nanobind by @daidahao in #5091
- Migrate lower_credit to nanobind by @daidahao in #5081
- Migrate mask construction to nanobind by @daidahao in #5082
- Migrate masked-model output utilities to nanobind by @daidahao in #5092
- Remove Numba and llvmlite from dependencies and support free-threaded Python by @CloseChoice in #5129
- Run tests and build wheels for Python 3.15, including pre-releases, by @CloseChoice in #5143
- Add Windows ARM64 builds by @ndabas in #5137
- Add Emscripten builds by @CloseChoice in #5162
Other Changes
- Remove AppVeyor and .claude files from the build directory by @CloseChoice in #5023
- Increase test coverage for shap/maskers/_image.py by @bedupako12mas in #4519
- Document ASV performance monitoring by @daidahao in #5083
- Remove llvmlite and Numba restrictions on macOS by @CloseChoice in #5117
- Add type hints for plots._benchmark by @siddharth7113 in #5101
- Build and upload nightly wheels to scientific-python-nightly-wheels by @CloseChoice in #5136
- Skip nightly wheel builds when the default branch is unchanged by @CloseChoice in #5141
- Update actions/checkout to v7.0.1 and pin its commit SHA by @CloseChoice in #5144
- Update Dependabot configuration by @CloseChoice in #5145
- Rename master to main by @CloseChoice in #5153
- Add docstrings to exception classes in _exceptions.py by @adt-kmr in #5208
New Contributors
- @bedupako12mas made their first contribution in #4519
- @siddharth7113 made their first contribution in #5101
- @SushantTusharJoshi made their first contribution in #5126
- @ndabas made their first contribution in #5137
- @Atishyy27 made their first contribution in #5164
- @clark874 made their first contribution in #5163
- @adt-kmr made their first contribution in #5208
Full Changelog: v0.52.0...v0.53.0
v0.53.0rc0
Highlights
- Python 3.15.0rc2 support: SHAP now builds and runs tests against Python 3.15 pre-releases, including Python 3.15.0rc2. By @CloseChoice in #5143
- Migration away from Numba and llvmlite: core utilities have been migrated to nanobind/C++, allowing Numba and llvmlite to be removed as required dependencies and enabling support for free-threaded Python. By @daidahao and @CloseChoice in #5081, #5082, #5088, #5089, #5090, #5091, #5092, #5117, #5129
- GPU TreeSHAP improvements: LightGBM categorical GPU TreeSHAP support has been added, alongside TreeExplainer changes and CPU/GPU equivalence testing for categorical features. By @RAMitchell and @CloseChoice in #5020 and #5026
What's Changed
Fixes
- Refactor short circuiting of tree_path_dependent shap calculation by @CloseChoice in #5069
- Remove outdated TensorFlow version warnings from DeepExplainer by @SushantTusharJoshi in #5126
Enhancements
- Support LightGBM categorical GPU TreeSHAP by @RAMitchell in #5020
- Use TreeEnsemble directly in TreeExplainer and add cpu gpu equivalence tests for categories by @CloseChoice in #5026
- Add GPU build, packaging, CI, smoke tests, and TestPyPI support by @CloseChoice in #5057, #5058, #5114, #5123, #5127
- ENH: Move optional-dep into dep-groups by @daidahao in #4589
- ENH: Performance monitoring for explainers by @daidahao in #5071
- PERF: Remove Numba from image masker by @daidahao in #5089
- PERF: Migrate clustering utilities to nanobind by @daidahao in #5088
- PERF: Migrate tabular masking utilities to nanobind by @daidahao in #5090
- PERF: Migrate ExactExplainer interaction utility to nanobind by @daidahao in #5091
- PERF: Migrate lower_credit to nanobind by @daidahao in #5081
- PERF: Migrate mask construction to nanobind by @daidahao in #5082
- PERF: Migrate masked-model output utilities to nanobind by @daidahao in #5092
- remove numba and llvmlite from dependencies, support free-threaded python by @CloseChoice in #5129
- run tests and build wheels for python 3.15 (including pre-release) by @CloseChoice in #5143
- Add Windows ARM64 build by @ndabas in #5137
Other Changes
- TST: Increase test coverage for shap/maskers/_image.py by @bedupako12mas in #4519
- DOC: Document ASV performance monitoring by @daidahao in #5083
- remove llvmlite and numba restrictions on macos by @CloseChoice in #5117
- TYP: add type hints for plots._benchmark by @siddharth7113 in #5101
- Build and upload nightly wheels to scientific-python-nightly-wheels by @CloseChoice in #5136
- update bundle js by @CloseChoice in #5139
- Skip nightly wheel build when master is unchanged by @CloseChoice in #5141
- Update actions/checkout to v7.0.1 and pin its commit SHA by @CloseChoice in #5144
- update dependabot by @CloseChoice in #5145
New Contributors
- @bedupako12mas made their first contribution in #4519
- @siddharth7113 made their first contribution in #5101
- @SushantTusharJoshi made their first contribution in #5126
- @ndabas made their first contribution in #5137
Full Changelog: v0.52.0...v0.53.0rc0
v0.52.0
What's Changed
Highlights
- Native bindings rewritten with nanobind, and the build system migrated
fromsetup.pyto scikit-build-core + CMake. The Cython
_kernel_lib.pyxand the existing_cext/_cext_gpumodules are now
built as nanobind extensions, andMANIFEST.in/setup.pyhave been
removed in favor of apyproject.toml-driven build. (#4366, by
@CloseChoice and @daidahao and @claude) - Minimum dependency versions raised to follow SPEC 0. (#4310, by @CloseChoice)
Enhancements
- Log an
INFOmessage when background data is sub-sampled (closes #3461).
(#4294, by @Ebube22) - Add cross-links between the API Reference and API Examples pages.
(#4329, by @Abhishek9639) - Drop the unused
typing-extensionsdependency. (#4629, by @samudraneel05)
Bug Fixes
- Improve GPU TreeExplainer parity: preserve XGBoost default/missing child
routing so NaN values follow the same branch as the source model, preserve
vector-valued XGBoostbase_scorevalues (fixing multiclass additivity
offsets), and tighten categorical handling so sklearn models with
enable_categorical=Trueraise the existing unsupported-categorical error
even when the booster does not exposefeature_types. (#4997, by
@RAMitchell) - TreeExplainer no longer crashes with pandas nullable dtypes.
(#4298, by @tudstudent) - Fix
NameErrorwhenwith_binary=Falseandwith_cuda=Trueby
initializingcompile_args. (#4322, by @mohityadav8) - Text plot colors render correctly by converting NumPy types to float.
(#4332, by @Saloni-0465) - Assign the result of
np.flipudso it is no longer a no-op in
AdditiveForceArrayVisualizer. (#4343, by @Mahaveerjain-18) - Use
isinstance()instead ofisfor type checks. (#4373, by @divyam-jha123) - Record
'sample'inExplanation.op_historyinstead of'__getitem__'.
(#4376, by @tarun-227) - Move the unreachable large-dataset warning into the interventional branch.
(#4392, by @Mahaveerjain-18) - Fix "structure of inputs doesn't match the expected structure".
(#4410, by @shaivimalik) - Fix the return value from
is_color_map()inplots/_beeswarm.py.
(#4421, by @maniktyagi04) - Suppress the
UserWarningwhenLGBMRegressorwas fitted with feature
names. (#4422, by @shaivimalik) - Correct
max_evalscalculation inPermutationExplainer.shap_values().
(#4434, by @AftAb-25) - Fix incorrect measure calls in
benchmark/metrics.py.
(#4447, by @Jiya873) - Handle zero division in the heatmap when all SHAP values are zero.
(#4449, by @BaibhavKundu2005) - Correct file path handling in
make_dir(image.py).
(#4501, by @Abhishek-Kumar-Rai5) - Use
isinstance()instead oftype() isfor tuple checks.
(#4508, by @neha222222) - Warn when the covariance matrix is singular in LinearExplainer.
(#4471, by @BaibhavKundu2005) - Remove a debug print and a typo in
serializable.
(#4336, by @dhiraj-143r)
Maintenance
- Fix a NumPy deprecation warning in the coalition explainer.
(#4291, by @CloseChoice) - Fix deprecated NumPy dtype aliases in
test_kernel.py.
(#4302, by @peteroyce) - Replace the deprecated
input_shapekwarg with anInputlayer in tests.
(#4301, by @kvr06-ai) - Replace deprecated
return_all_scoreswithtop_k=None(#3974).
(#4393, by @shauryam2807) - Remove dead code in
utils/_keras.py(unused and broken on Keras 3).
(#4625, by @SuMayaBee) - Remove the dead
__check_cachefunction and stale cache variables in
benchmark. (#4485, by @dhiraj-143r) - Update bundled JS. (#4308, by @CloseChoice)
Type Hints
- Add type hints for
explainers.other._random. (#4436, by @SarthakB11)
Tests
- Add SHAP values baselines. (#4307, by @CloseChoice)
- Add more exact explainer
#4366tests. (#4312, by @CloseChoice) - Re-enable causalml tests. (#4311, by @dhiraj-143r)
- Make force plot tests deterministic to fix macOS flakiness (#4102).
(#4315, by @Abhishek9639) - Add a new exact explainer test. (#4364, by @CloseChoice)
- Use the default matplotlib style for tests. (#4330, by @Anushreebasics)
- Restore pytest discovery for
shap.actions. (#4350, by @JRV7903) - Improve test coverage for the Action base class. (#4514, by @Jiya873)
- Add tests in
tests/explainers/test_linear.py. (#4416, by @naxatra2) - Increase test coverage for
shap/explainers/other/_treegain.py.
(#4427, by @rupeshca007)
Documentation
- Update LightGBM links. (#4296, by @jameslamb)
- Fix Python installation version from 3.11 to 3.12. (#4319, by @kronzter)
- Fix a broken link. (#4400, by @Jiya873)
- Update the Iris classification notebook to use the modern SHAP API.
(#4318, by @JRV7903) - Fix typos in the heatmap notebook. (#4359, by @Bot87Ever)
- Reformat the waterfall notebook. (#4378, by @justin212407)
- Improve clarity and documentation in the sentiment analysis notebook.
(#4397, by @24f3004086) - Improve the embedding plot docstring. (#4438, by @Jiya873)
- Modernize the "Fitting a Linear Simulation with XGBoost" notebook.
(#4428, by @vibhor-5) - Fix spelling errors in source code docstrings and comments.
(#4446, by @rupeshca007) - Clarify the
expected_valuemath formula in TreeExplainer (#4414).
(#4418, by @DashratRajpurohit)
New Contributors
- @daidahao made their first contribution in #4366
- @peteroyce made their first contribution in #4302
- @kvr06-ai made their first contribution in #4301
- @dhiraj-143r made their first contribution in #4311
- @Abhishek9639 made their first contribution in #4315
- @kronzter made their first contribution in #4319
- @Jiya873 made their first contribution in #4400
- @shauryam2807 made their first contribution in #4393
- @Ebube22 made their first contribution in #4294
- @JRV7903 made their first contribution in #4318
- @mohityadav8 made their first contribution in #4322
- @Saloni-0465 made their first contribution in #4332
- @Anushreebasics made their first contribution in #4330
- @Bot87Ever made their first contribution in #4359
- @SuMayaBee made their first contribution in #4625
- @divyam-jha123 made their first contribution in #4373
- @justin212407 made their first contribution in #4378
- @samudraneel05 made their first contribution in #4629
- @Mahaveerjain-18 made their first contribution in #4392
- @24f3004086 made their first contribution in #4397
- @shaivimalik made their first contribution in #4410
- @tarun-227 made their first contribution in #4376
- @maniktyagi04 made their first contribution in #4421
- @naxatra2 made their first contribution in #4416
- @rupeshca007 made their first contribution in #4427
- @vibhor-5 made their first contribution in #4428
- @SarthakB11 made their first contribution in #4436
- @AftAb-25 made their first contribution in #4434
- @DashratRajpurohit made their first contribution in #4418
- @Abhishek-Kumar-Rai5 made their first contribution in #4501
- @BaibhavKundu2005 made their first contribution in #4449
- @neha222222 made their first contribution in #4508
Full Changelog: v0.51.0...v0.52.0
v0.51.0
What's Changed
Fixes
- fix: check first that the feature is not in the leaf node by @Far-naz in #4268
- Fix missing array to scalar conversion in MAPLE by @Scienfitz in #4285
- fix Python Version of Tree SHAP notebook by @CloseChoice in #4289
- Fix path-dependent SHAP NaN with small background datasets by @tudstudent in #4272
- Fix IndexError in format_value() when handling empty strings by @Copilot in #4238
- Fix test_scatter_categorical for pandas 3.0 compatibility by @Copilot in #4253
- Fix SamplingExplainer.explain for Series. by @ljw20180420 in #4200
Other Changes
- Add tests for fixed masker by @CloseChoice in #4216
- Add comprehensive type hints to production code by @CloseChoice in #4217
- unpin versions and pin numba, skip causalml test by @CloseChoice in #4235
- Clarify TreeExplainer binary classification returns different shapes per model by @Copilot in #4254
- Add tests for explainers by @CloseChoice in #4218
- Add Colab Notebook to test GPUTreeExplainer by @CloseChoice in #4266
- Fix spelling error in docs: perterbation to perturbation by @laffertyryan0 in #4275
- update test_scatter to work with latest xgboost by @CloseChoice in #4278
- add ai usage policy at appropriate place in contributing, mention contributing in readme by @CloseChoice in #4279
- deprecate testing of newer llvmlite versions on macos x64_86 by @CloseChoice in #4286
New Contributors
- @ljw20180420 made their first contribution in #4200
- @Copilot made their first contribution in #4238
- @laffertyryan0 made their first contribution in #4275
- @tudstudent made their first contribution in #4272
- @Far-naz made their first contribution in #4268
- @Scienfitz made their first contribution in #4285
Full Changelog: v0.50.0...v0.51.0
v0.50.0
What's Changed
- hand over threshold_types to GPUTreeExplainer by @CloseChoice in #4181
- Improve base_score assignment by @lsdxp in #4187
- test against python 3.14, remove support for python 3.9 and 3.10 by @CloseChoice in #4176
- Always force transformers label2id ids to integers by @evamaxfield in #4192
- Fix gpu tree explainer tests by @CloseChoice in #4199
New Contributors
- @lsdxp made their first contribution in #4187
- @evamaxfield made their first contribution in #4192
Full Changelog: v0.49.1...v0.50.0
v0.49.1
What's Changed
Fix broken v0.49.0 release.
The previous Release wasn't properly published due to HTTP errors on MacOS.
v0.49.0
What's Changed
NOTE: this is the last release supporting Python 3.9 AND Python 3.10. From v0.50.0 onwards, we'll only support Python 3.11 and above.
- Add support for categorical splits in C++ library by @nqviller in #4171
- Add options to customize the color bar of the violin plot by @FanwangM in #4119
Other Changes
- plots.image show labels for every row if provided by @julesvanrie in #4113
- use nbtest by @CloseChoice in #4143
- Added Support for PyTorch
Flatenby @RoyiAvital in #4148 - Update .save() and .load() methods to remove AttributeError in Explainer and Serializer by @oscarl77 in #4155
- fix for missing objective error for LGBMRegressor by @imatiach-msft and @CloseChoice in #1063
- Fix potential TypeError in numeric feature branch by adding string conversion for feature names #4150 by @YunyuG in #4159
- Improve Coalition Explainer User Guidance and Fix Tree Building by @EnzoFanAccount in #4116
New Contributors
- @diego-pm made their first contribution in #4110
- @julesvanrie made their first contribution in #4113
- @Helias made their first contribution in #4141
- @oscarl77 made their first contribution in #4155
- @FanwangM made their first contribution in #4119
- @YunyuG made their first contribution in #4159
- @EnzoFanAccount made their first contribution in #4116
- @nqviller made their first contribution in #4171
Full Changelog: v0.48.0...v0.49.0
v0.48.0
What's Changed
Added
- Add CoalitionExplainer and add possibility of using Winter Values in Partition Explainer by @CousinThrockmorton in #3666
- Support and test against Python 3.13 by @connortann in #3861 and @CloseChoice in #4104
- Add Support for PyTorch
IdentityLayer by @RoyiAvital in #4028
Documentation
- Update Explaining a model that uses standardized features by @randombenj in #3903
Other Changes
- Changed alias by @Ja-Tink in #4049
- update javascript packages by @CloseChoice in #4067
- Fixed visual bug for small SHAP values by @Ja-Tink in #4053
- Fix summary_plot displays only one feature 4081 by @CloseChoice in #4087
- resolve threading warnings of regex library by @emmanuel-ferdman in #4084
New Contributors
- @RoyiAvital made their first contribution in #4028
- @Ja-Tink made their first contribution in #4049
- @emmanuel-ferdman made their first contribution in #4084
- @randombenj made their first contribution in #3903
- @CousinThrockmorton made their first contribution in #3666
Full Changelog: v0.47.2...v0.48.0
v0.47.2
What's Changed
Added
- Add experimental causalml support by @alexander-pv in #3273
Other Changes
- DOCS: clarity for partition tree explanation in
Simple California Demo.ipynbby @ethanknights in #4027 - FIX: unique value jitter by @fabianliebig in #4041
- FIX: fix neutral language in SHAP value description by @Hrafz in #4058
- FIX regression test for javascript plotting compontents and add tests by @CloseChoice in #4060
New Contributors
- @ethanknights made their first contribution in #4027
- @Hrafz made their first contribution in #4058
Full Changelog: v0.47.1...v0.47.2