SHAP values must add up to the difference between the prediction and the baseline prediction. This check is the efficiency property of Shapley values, and it is a quick way to catch a bug in an attribution method.
Implement additivity_gap(phi, f_x, f_base), returning the sum of the attributions minus the output difference.
Sum the attributions and subtract f_x - f_base.
No results yet
Run your code to check it against the examples, or submit to run every test.