Download Latest Version v0.53.0rc0 source code.zip (163.7 MB) Google Add to Preferred Sources
Home / v0.52.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-05-28 8.3 kB
v0.52.0 source code.tar.gz 2026-05-28 162.0 MB
v0.52.0 source code.zip 2026-05-28 162.2 MB
Totals: 3 Items   324.2 MB 0

What's Changed

Highlights

  • Native bindings rewritten with nanobind, and the build system migrated from setup.py to scikit-build-core + CMake. The Cython _kernel_lib.pyx and the existing _cext / _cext_gpu modules are now built as nanobind extensions, and MANIFEST.in / setup.py have been removed in favor of a pyproject.toml-driven build. (#4366, by @CloseChoice and @daidahao and @claude)
  • Minimum dependency versions raised to follow SPEC 0. (#4310, by @CloseChoice)

Enhancements

  • Log an INFO message 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-extensions dependency. (#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 XGBoost base_score values (fixing multiclass additivity offsets), and tighten categorical handling so sklearn models with enable_categorical=True raise the existing unsupported-categorical error even when the booster does not expose feature_types. (#4997, by @RAMitchell)
  • TreeExplainer no longer crashes with pandas nullable dtypes. (#4298, by @tudstudent)
  • Fix NameError when with_binary=False and with_cuda=True by initializing compile_args. (#4322, by @mohityadav8)
  • Text plot colors render correctly by converting NumPy types to float. (#4332, by @Saloni-0465)
  • Assign the result of np.flipud so it is no longer a no-op in AdditiveForceArrayVisualizer. (#4343, by @Mahaveerjain-18)
  • Use isinstance() instead of is for type checks. (#4373, by @divyam-jha123)
  • Record 'sample' in Explanation.op_history instead 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() in plots/_beeswarm.py. (#4421, by @maniktyagi04)
  • Suppress the UserWarning when LGBMRegressor was fitted with feature names. (#4422, by @shaivimalik)
  • Correct max_evals calculation in PermutationExplainer.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 of type() is for 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_shape kwarg with an Input layer in tests. (#4301, by @kvr06-ai)
  • Replace deprecated return_all_scores with top_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_cache function 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 [#4366]tests. (#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_value math formula in TreeExplainer (#4414). (#4418, by @DashratRajpurohit)

New Contributors

Full Changelog: https://github.com/shap/shap/compare/v0.51.0...v0.52.0

Source: README.md, updated 2026-05-28