eli5 icon indicating copy to clipboard operation
eli5 copied to clipboard

Improve targets argument for explain_prediction_keras

Open teabolt opened this issue 5 years ago • 0 comments

Currently explain_prediction_keras (https://github.com/TeamHG-Memex/eli5/pull/315) supports the targets parameter (that is used to explain a particular class, specified by an interger ID). The argument must be a length 1 list of ints, i.e. targets=[123] is valid.

We want to make a number of improvements to this interface:

  • Support more than just one target in the list, i.e. allow the user to say something like targets=[123, 324]. We would need to decide what meaning would this have, i.e. are we explaining multiple classes at once, or are we doing separate explanations for each target in the list.
  • For single targets, support passing just the target instead of a singleton list, i.e. targets=[42] would become targets=42. This would need changes to the explain_prediction generic function (mypy annotations).
  • Support specifying targets not just by integer id's. For example, the user could pass something like targets='cat' to explain the class with the label cat (see also https://github.com/TeamHG-Memex/eli5/issues/319). float types could be supported for regression tasks, once regression is implemented?

teabolt avatar Jun 27 '19 14:06 teabolt