Open Scienfitz opened 2 weeks ago
I really like this approach. There could be multiple reasons why decoupling the plotting from the calculation of the SHAP values might be preferred:
Thanks, @Scienfitz, for the nice summary! I think it is very difficult to provide definitive answer to all your questions at the current point since there are still so many unclear parts, like
feature_importance
, model_fit
, ...?Anyway, only time will show us what is needed, so I think let's just start with one or two methods in mind and adapt from there. So regarding your questions:
For @AdrianSosic as he is going on longer absence, it would be good to have your definitive decisions on these questions before that.
- Are you OK with the above structure, any alternatives you propose or issues?
- For instance, should the utilities already do the plots or only provide shap values or plot be an optional argument to the utility?
- SHould the utilities accept campaigns, recommenders or both?
- This requrires additional dependencies, at the very least
shap
but probably others for the non-shap methods (that might still come as part of the shap package see above). I would group all of those into a new optional dependency groupdiagnostics
or do we need that more finegrained or even let if fail at runtime?
Explainer
and to evaluate it. These are generally two different things.plot
methoddef campaign.explain()
that then internally takes care of collecting the relevant bits and pieces.diagnostics
for now and extend later if needed.
Opening this issue to collect and plan around the upcoming diagnostics package.
After #355 is merged, the last fitted surrogate model will be available. Since we deal with bayesian models our model exposes a
posterior
method. Applying.mean
turns this into a model essentially comparable to standard predictive models. Our last refactoring ensured that the input to that model can be in experimental representation, i.e. the same as accepted byadd_measurements
, i.e. it can include the unencoded labels etc.Preliminary Example @AdrianSosic already shared how to utilize this in the PR, for easier access I will copy the crucial part of his example here:
@brandon-holt @alex6022 tagging you here so you have this simple example to go already after #355 is merged. Questions or feedback on this application should ideally be collected here and not in the PR.
Turning this into a diagnostics package Since the very start of this package we had requests for diagnostics, SHAP is one of them, but more traditional users might also want to look at traditional metrics such as goodness of fit etc etc.
Essentially we are now proposing to turn the above code into a subpackag that can be used like this:
Note that SHAP explainers seem to have a common interface
(model, data)
which means we can allow any shap explainer importable viashap.explainer
andshap.explainer.other
. The latter even offers non-shap methods such as LIME and MAPLE via the same interface.Conversely, we could have things like
Open Questions For @AdrianSosic as he is going on longer absence, it would be good to have your definitive decisions on these questions before that.
shap
but probably others for the non-shap methods (that might still come as part of the shap package see above). I would group all of those into a new optional dependency groupdiagnostics
or do we need that more finegrained or even let if fail at runtime?