SALib.analyze.shapley module#

SALib.analyze.shapley.analyze(problem: dict, X: ndarray, Y: ndarray, conf_level: float = 0.95, print_to_console: bool = False) → ResultDict[source]#

Estimate Shapley effects with Goda’s Monte Carlo algorithm.

Returns Shapley effects in output-variance units (shapley, summing to the overall output variance) alongside normalized shares that sum to one (shapley_normalized), each with a normal-approximation confidence interval half-width (shapley_conf, shapley_normalized_conf).

Notes

Compatible with:

Compatible with SALib.sample.shapley.sample(). The estimator assumes mutually independent inputs and does not support grouped parameters.

Parameters:
  • problem (dict) – The problem definition.

  • X (numpy.ndarray) – Model inputs generated by SALib.sample.shapley.sample().

  • Y (numpy.ndarray) – One-dimensional array of model outputs.

  • conf_level (float, default=0.95) – Confidence level used for normal-approximation interval half-widths.

  • print_to_console (bool, default=False) – Print results directly to the console.

Returns:

Raw and normalized Shapley effect estimates, their confidence interval half-widths, and factor names.

Return type:

ResultDict

References

  1. Goda, T. (2021). A simple algorithm for global sensitivity analysis with Shapley effects. Reliability Engineering & System Safety, 213, 107702. https://doi.org/10.1016/j.ress.2021.107702

SALib.analyze.shapley.cli_action(args)[source]#

Analyze Shapley trajectories from command-line arguments.

SALib.analyze.shapley.cli_parse(parser)[source]#