github shap/shap v0.36.0

latest releases: v0.45.0, v0.44.1, v0.44.0...
3 years ago

This version contains a significant refactoring of the SHAP code base into a new (cleaner) API. Full backwards compatibility should be retained, but most things are now available in locations with the new API. Note that this API is still in a beta form, so refrain from depending on it for production code until the next release. Highlights include:

  • A new shap.Explainer object that auto-chooses the explainer based on the given model and masking dataset.
  • A new shap.Explanation object that allows for parallel slicing of data, SHAP values, base values (expected values), and other explanation-specific elements.
  • A new shap.maskers.* module that separates the various ways to mask (i.e. perturb/hide) features from the algorithms themselves.
  • A new shap.explainers.Partition explainer that can explain any text or image models very quickly.
  • A new shap.maskers.Partition masker that ensures tightly grouped features are perturbed in unison, so preventing "unrealistic" model inputs from inappropriately influencing the model prediction. It also allows for the exact quadratic time computation of SHAP values for the 'structured games' (with coalitions structured according to a hierarchical clustering).
  • A new shap.plots.* module with revamped plot types that all support the new API. Plots are now named more directly, so summary_plot (default) becomes beeswarm, and dependent_plot becomes scatter. Not all the plots have been ported over to the new API, but most have.
  • A new notebooks/plots/* directory given examples of how to use the new plotting functions.
  • A new shap.plots.bar function to directly create bar plots and also display hierarchical clustering structures to group redundant features together, and show the structure used by a Partition explainer (that relied on Owen values, which are an extension of Shapley values).
  • Equally check fixes courtesy of @jameslamb
  • Sparse kmeans support courtesy of @PrimozGodec
  • Pytorch bug fixes courtesy of @rightx2
  • NPM JS code clean up courtesy of @SachinVarghese
  • Fix logit force plot bug courtesy of @ehuijzer
  • Decision plot documentation updates courtesy of @floidgilbert
  • sklearn GBM fix courtesy of @ChemEngDataSci
  • XGBoost 1.1 fix courtesy of @lrjball
  • Make SHAP spark serializable courtesy of @QuentinAmbard
  • Custom summary plot color maps courtesy of @nasir-bhanpuri
  • Support string inputs for KernelSHAP courtesy of @YotamElor
  • Doc fixes courtesy of @imatiach-msft
  • Support for GPBoost courtesy of @fabsig
  • Import bug fix courtesy of @gracecarrillo and @aokeson

Don't miss a new shap release

NewReleases is sending notifications on new releases.