feedzai / timeshap

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

TypeError: plot_global_event not propogating plot_parameters correctly #26

Closed jornjan closed 1 year ago

jornjan commented 1 year ago

Hi, First of all, awesome package! I was able to already create interesting visualizations.

Currently, I run into an error concerning the plot_global_event method in src/timeshap/plot/event_level.py, which raises an TypeError when I pass a dictionary with plot_parameters, see snippet below,

plot_params = {'width': 500, 'height': 500}
event_global_plot = plot_global_event(event_global_data, plot_params)
event_global_plot

This raises the following error:

TypeError: plot() takes 2 positional arguments but 3 were given

The issue occurs at the following line in the multi_plot_wrapper method, where the plot method wrapped in plot_global_event is called:

param_plot = method(filtered_data, {}) if parameters is None else method(filtered_data, *parameters)

I have been trying some ideas to correctly pass the plot_parameters dictionary, but without success. Do you have any suggestion for a solution?

JoaoPBSousa commented 1 year ago

Hello @jornjan, Thank you very much for the interest and noticing this.

This was indeed a problem with our methods, which I have fixed already and pushed a new commit to the repository. You should now be able to use the plot_params as you were.

Any further doubts or suggestions don't hesitate to contact us.