Skip to content
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

Add plots for metrics and timeseries #84

Merged
merged 4 commits into from
Feb 7, 2022
Merged

Add plots for metrics and timeseries #84

merged 4 commits into from
Feb 7, 2022

Conversation

AntoninPoche
Copy link
Collaborator

@AntoninPoche AntoninPoche commented Jan 14, 2022

Plots for metrics and timeseries

For metrics, the plots are added in 996fad3 and tested in d755524.
For timeseries, the plots are added in 70ded0d and tested in be8ff60.

Metrics

Those are two plots that I often use. I though they may need to be integrated in Xplique.

I also made is so that each method can be assign a color and match between both plots.

Metrics histograms

This one to compare the attribution methods through several metrics:
barplot_test

Fidelity curves

This plot show the evolution of the score depending on the number of features perturbed. It is also used to compare methods. It can easily be done thank to the detailed_evaluate() method of CausalFidelity and CausalFidelity introduced in pull request #70.

Note that the lines on this plot are just here for testing the function.
fidelity_curves_test

Timeseries

The following plots come from the same function, they both output heatmaps. But for the first, a numpy array is given while the second receives a dictionary of numpy arrays.

One explanation heatmap

timeseries_one_attribution_test

Several explanations heatmaps

This plot should adapt the arrangement of the subplots based on the heatmap shape and their number.
timeseries_several_attributions_test

Copy link
Collaborator

@lucashervier lucashervier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Really neat and easy to understand code, well done! I just add some remarks concerning documentation and issues related to linting (and the in-coming hooker)! In addition, can you please edit your PR message to link this PR to related issues ?

Copy link
Member

@fel-thomas fel-thomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't wait to see this feature merged! We should make a notebook with it, congratulations Antonin! 🎉
Some minor changes in line with @lucashervier, nothing major ;)

tests/plots/test_metric_plots.py Show resolved Hide resolved
xplique/plots/metrics.py Outdated Show resolved Hide resolved
xplique/plots/metrics.py Outdated Show resolved Hide resolved
xplique/plots/metrics.py Outdated Show resolved Hide resolved
Copy link
Member

@fel-thomas fel-thomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, All my comments are addressed, once Lucas is ok you can merge ;)

@AntoninPoche AntoninPoche changed the title Add plots for metrics Add plots for metrics and timeseries Feb 3, 2022
@AntoninPoche
Copy link
Collaborator Author

The remarks from Lucas has been taken into account.
The code from Thomas has been integrated.
Plots for timeseries have been added.

I hope this is better ! I just have a pylint check that does not pass, but it does not seems to come from my code but from the checking (impossible to load keras issue).

@fel-thomas
Copy link
Member

fel-thomas commented Feb 4, 2022

Even better, I approved 2 days ago, I agree for Pylint I made fix the issue in David's PR that should be merge as soon as someone approve (I already approved it) 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fidelity evolution curve visualization Time Series explanation visualization
3 participants