SALib.plotting.shapley module#

Bar chart for Shapley effects.

Raw Shapley effects (output-variance units) and their normalized shares (unit interval, summing to one) sit on incompatible scales, so plotting all four shapley/shapley_conf/shapley_normalized/ shapley_normalized_conf columns together in a single bar chart (the default behavior inherited from ResultDict.plot) makes the smaller series unreadable. This module plots one pair at a time instead, defaulting to the normalized shares since those are what’s usually of interest.

SALib.plotting.shapley.plot(Si, ax=None, normalized=True)[source]#

Plot Shapley effects as a bar chart.

Parameters:
  • Si (ResultDict) – Analysis results, as returned by SALib.analyze.shapley.analyze().

  • ax (matplotlib axes object, optional) – Axes to plot onto. Creates a new figure if not provided.

  • normalized (bool, default=True) – Plot the normalized shares (summing to one) rather than the raw effects in output-variance units.

Returns:

ax

Return type:

matplotlib axes object