feedzai / timeshap

TimeSHAP explains Recurrent Neural Network predictions.
Other
162 stars 30 forks source link

Intuition around pruning/baseline selection #23

Closed xydisla closed 2 years ago

xydisla commented 2 years ago

While calculating a global report, I'm currently running into errors that "Score difference between baseline and instance is too low < 0.1...Consider choosing another baseline." My baselines have been the average_event and average_sequence. I also notice that occasionally the values in the error change with different pruning tolerance, but not in a consistent way. Do you have advice for dealing with this? Thanks.

JoaoPBSousa commented 2 years ago

Hello @xydisla,

This error occurs when using TimeSHAP's pruning and the baseline score is very close to the score of the instance being explained. TimeSHAP, and KernelSHAP, explain the difference in score between the baseline and the explained instance, if this score is small, the explanation values will be small and therefore TimeSHAP's pruning algorithm cannot operate. To solve this issue you have two options: 1. Skip the pruning algorithm. This error is raised when applying the pruning algorithm, if you skip it, TimeSHAP should calculate the event and feature explanations, albeit with very small contributions. 2. Change the baseline sequence. Consider changing the baseline instance. If you are explaining an instance with class label 1, consider using the average of all instances of class 0 as the baseline, and vice-versa, if explaining class 0, use the average of all sequences of class 1.

If you have any further questions, don't hesitate to contact us.

JoaoPBSousa commented 2 years ago

Closed this issue due to inactivity. If you have any further questions feel free to re-open the issue or create a new one.