-
Notifications
You must be signed in to change notification settings - Fork 13
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
560 improve results of lime timeseries notebooks #589
560 improve results of lime timeseries notebooks #589
Conversation
…otebook-LIME-timeseries
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! I noticed that you use explain_timeseries
in the notebooks. But when using method='lime'
or method='rise'
gives different output. The interface is not consistant. Is this something that can be fixed in this PR or should it be a new issue?
Lime gives back an explanation instance:
>>> lime_exp = dianna.explain_timeseries(
>>> run_expert_model,
>>> timeseries_data=data_extreme,
>>> method='lime',
>>> labels=[0,1],
>>> class_names=["summer", "winter"],
>>> num_features=len(data_extreme),
>>> num_samples=10000,
>>> num_slices=len(data_extreme),
>>> distance_method='euclidean',
>>> mask_type=input_train_mean)
>>> rise_exp
<lime.explanation.Explanation at 0x7f8dbf2dfe20>
Rise gives back a numpy array:
>>> rise_exp = dianna.explain_timeseries(
>>> run_expert_model,
>>> timeseries_data=data_extreme,
>>> method='rise',
>>> labels=[0,1],
>>> p_keep=0.1,
>>> n_masks=10000,
>>> mask_type=input_train_mean)
>>> rise_exp
array([[[7.700e-02],
[3.000e-03],
...
[4.000e-03]],
[[9.650e-01],
[9.820e-01],
...
[1.053e+00]]])
>>> rise_exp.shape
(2, 28, 1)
Hi @stefsmeets , thanks a lot for your review and quick feedback 😄. Let me take a quick look into the interface, that's a bit unexpected. I will try to fix it in this PR, if possible.
This is because we use the |
@stefsmeets I just updated the returned values of LIME timeseries explainer and it is an array, which is consistent with RISE. I also updated the notebook ( Just take another look and let me know if you have more comments, thanks @stefsmeets ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Looks good to me! 🚀
We try to fine-tune the parameters of lime timeseries and improve the results in the notebooks (
lime_timeseries_coffee.ipynb
andlime_timeseries_weather.ipynb
).Note that because of the absence of strategic segmentation and multi-channels masking, the results and visualization are not perfect. But they got much improved than before (at least good enough to show during the surf event.)