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

569 multivariate timeseries visualization #591

Merged
merged 25 commits into from
Jun 1, 2023

Conversation

cwmeijer
Copy link
Contributor

Adds multivariate support to the timeseries visualization:

image

@cwmeijer cwmeijer requested a review from loostrum May 15, 2023 09:50
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@elboyran
Copy link
Contributor

@loostrum do you have a chance to review this?

Copy link
Contributor

@stefsmeets stefsmeets left a comment

Choose a reason for hiding this comment

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

The graphs look great! But I'm not entirely happy with this PR.

  1. The docstring for plot_timeseries does not entirely cover the functionality. Could you update it to make it more clear how the function works with multivariate data?

  2. The interface is not the same as before for monovariate data. To me it was not directly obvious what changes I needed to make to get it to work. I had to fiddle with x and y, and adjust the segments to get it to work. Better documentation and checks to make it clear what is wrong would help.

That said, I'm thinking that it may be worth to consider splitting plot_timeseries into plot_timeseries and plot_timeseries_multi to keep the API clear. To me, this function is not intuitive at the moment. Part of the reason is also having to define segments each time to call it, this could be integrated into the explain_timeseries function. Not to be addressed in this PR, but definitely something to follow up on.

  1. Can you also have another look at the notebooks? The notebooks break whenever the plot_timeseries function is called on my end:

ValueError: x and y must have same first dimension, but have shapes (28,) and (1,)

I think either the segments are not correctly defined or the shape of the input data is not right.

  1. I also left a couple of nitpicks that may improve the code clarity.

dianna/visualization/timeseries.py Outdated Show resolved Hide resolved
dianna/visualization/timeseries.py Outdated Show resolved Hide resolved
tests/test_visualization.py Outdated Show resolved Hide resolved
dianna/visualization/timeseries.py Outdated Show resolved Hide resolved
dianna/visualization/timeseries.py Outdated Show resolved Hide resolved
dianna/visualization/timeseries.py Show resolved Hide resolved
tests/test_visualization.py Show resolved Hide resolved
@cwmeijer cwmeijer requested a review from stefsmeets May 31, 2023 07:50
Copy link
Contributor

@stefsmeets stefsmeets 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, looks good to me!

@@ -6,7 +6,7 @@

def test_common_RISE_image_pipeline(): # noqa: N802 ignore case
"""No errors thrown while creating a relevance map and visualizing it."""
input_image = np.random.random((5, 5, 3))
input_image = np.random.random((224, 224, 3))
Copy link
Contributor

Choose a reason for hiding this comment

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

This would be a regression from #606 which we merged yesterday :-)

Suggested change
input_image = np.random.random((224, 224, 3))
input_image = np.random.random((5, 5, 3))

@cwmeijer cwmeijer merged commit 67794e5 into main Jun 1, 2023
21 of 22 checks passed
@cwmeijer cwmeijer deleted the 569-multivariate-timeseries-visualization branch June 1, 2023 14:02
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.

None yet

4 participants