Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for white-box explainers to alibi-explain runtime #1279

Merged
merged 20 commits into from
Jul 6, 2023

Conversation

ascillitoe
Copy link
Contributor

@ascillitoe ascillitoe commented Jul 3, 2023

Summary

This PR adds support for the sklearn API white-box explainers (TreeShap, TreePartialDependence, PartialDependenceVariance) to the AlibiExplainRuntime.

Implementation details

  • New runtime: Support is implemented via the new AlibiExplainSKLearnAPIRuntime subclass. For the remaining white-box explainers two further subclassed runtimes will be required (one being the IntegratedGradientsWrapper). See the notion doc for more details.

  • Tests: Some explainer's have various "nitty-gritty" details wrt to serving, for example the target kwarg for IntegratedGradients, calling fit with no data for TreeShap, and black-box/white-box mode of PartialDependenceVariance being determined by type(predictor). Therefore, the PR is proposing to perform an E2E test (test_end_2_end) on every explainer (with relevant parametrisation such as testing uri vs init_param's based loading). This would provide more confidence that all explainers can actually be served. However, it will increase the number of tests being run somewhat, so needs discussion...

TODO

  • Linting etc
  • Docs (leave until all white box explainers supported...)
  • Add tests to check loading of all supported tree models e.g. lightgbm models etc - done in afae1e6

Copy link
Contributor

@adriangonz adriangonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great PR @ascillitoe !!

I love the test thoroughness - the more tests the better IMO (as long as they are not massively slow!). Added a few comments here-and-there, but they are mainly questions and suggestions - nothing biggie.

Copy link
Contributor

@adriangonz adriangonz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one @ascillitoe! Thanks for making those changes.

Once the linter passes, this looks good to go from my side! Conscious it's still marked as a draft though, so happy to re-review once you think it's ready.

@ascillitoe
Copy link
Contributor Author

Thanks @adriangonz, I'll make the linter changes now and turn off draft once done!

@ascillitoe ascillitoe marked this pull request as ready for review July 6, 2023 10:13
@adriangonz adriangonz merged commit 7838eff into SeldonIO:master Jul 6, 2023
27 checks passed
@adriangonz adriangonz added this to In progress in v1.4.x via automation Jul 6, 2023
@adriangonz adriangonz moved this from In progress to Done in v1.4.x Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants