eli5
eli5 copied to clipboard
Improve targets argument for explain_prediction_keras
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 becometargets=42
. This would need changes to theexplain_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 labelcat
(see also https://github.com/TeamHG-Memex/eli5/issues/319).float
types could be supported for regression tasks, once regression is implemented?