pypi shap 0.52.0
v0.52.0

5 hours ago

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

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

Type Hints

Tests

Documentation

New Contributors

Full Changelog: v0.51.0...v0.52.0

Don't miss a new shap release

NewReleases is sending notifications on new releases.