-
Notifications
You must be signed in to change notification settings - Fork 333
Fix #890 Fix number of contiguous windows in snippet #894
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
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #894 +/- ##
=======================================
Coverage 98.93% 98.93%
=======================================
Files 84 84
Lines 14236 14292 +56
=======================================
+ Hits 14084 14140 +56
Misses 152 152
☔ View full report in Codecov by Sentry. |
@NimaSarajpoor Can you please double check that this produces the same result in the existing tutorial? Also, can you please insert a reference to the original issue in the initial comment (I notice that this has been missing)? |
Good point. I will check that out
Done! [if a summary of the issue is needed, plz let me know and I will revise the initial comment] |
The last figure changes in this branch (see Figure below) The last bar becomes taller. Two notes regarding this matter: (1) The matlab code provided in the snippet supporting webpage seems to suffer from the same problem:
In this MATLAB code, as shown above, the last snippet subsequence is ignored if (2) As a follow up to my previous note, I checked the length of the time series Let's consider two scenarios:
|
Q: Can we justify the figure shown in the previous comment? Let's use
Note that the 9-th snippet is the one colored in red. This seems to be a pattern that is a little bit different compared to the patterns on the first half and the ones on the second half of Q: Can we further justify that the code in this branch makes more sense?
Note that area is
Note that the last value of the array is 0, showing the start index of the last snippet computed with k=10. This is basically the black pattern shown in the figure above, which was missing when |
@seanlaw |
I am fine either way. If you have time to reach out to them then please do. Otherwise, I think I am satisfied with your justifications and am willing to merge. Your call. |
Sure. I will send an email to them as I want to make sure I am not missing anything here. [update-1] (1) I sent an email. @seanlaw Please feel free to merge if I don't provide any update regarding this matter in the next few days. (2) In the paper, we see the following statement:
Hence, I think the fixes [in this PR] make sense as it is based on what stated in the paper. [update-2] |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@NimaSarajpoor As I re-read your (excellent) comments above, it seems strange that the change-in-profile-area jumps so much for the 10th snippet. At the end of the day, given k=10, how would you interpret the change-in-profile-area and choose the "optimal number of snippets (k)"? Also, in the second-to-last plot (Profile Area) go from |
@seanlaw Before answering the question, I would like to correct the justification I provided before:
I think this justification, that I made recently, is not correct. Let's see something interesting here:
Note 1) For different seeds, the first snippet is always coming from the first half of Note 2) For different seeds, the second snippet is always coming from the second half of Note 3) The last snippet, however, is from the first half sometimes, and some other times, it is from the second half of Previouslly, the code in the tutorial notebook did not have the param
Let's discuss the formula
Let's plot Note the spike when Let's go back to the code I provided at the top of this comment: What happens if we consider When I set |
@NimaSarajpoor Can you please check the failed test? |
[update]
So, to make sure we are not missing any data, the last subsequence should be considered.
|
I think they are related to #881, which is [or should be] fixed by #892 [which has not been merged yet] |
Are you referring to the plot provided in the notebook? I intentionally did not change the value of However, now that we consider the last subsequence, the max value of |
Please pull main into this branch and let me know when this is ready to be merged |
What do you think? Do you want me to change |
Hmmm, I'm torn. If I were a user, I'd wonder why it doesn't go to |
Agree. Let's set |
As long as you explain how to interpret the plots/output, I don't think it is necessary to explain why it is different from the paper. |
bade4c3
to
9329ae1
Compare
@NimaSarajpoor Is this one ready to be merged? |
Would you mind checking the changes in the notebook? If you are okay with that, then I think it is ready. |
View / edit / reply to this conversation on ReviewNB seanlaw commented on 2023-08-11T16:20:21Z Line #1. plt.bar(range(2, k + 1), areas[:-1]/areas[1:] - 1.0, tick_label=range(2, k + 1))
Hmm, this is strange. When I do:
x = np.random.rand(10) I don't get a divide by zero warning. |
View / edit / reply to this conversation on ReviewNB seanlaw commented on 2023-08-11T16:20:22Z I think it should be all |
I changed and pushed the commit. |
It is strage! I tried it with numpy |
@NimaSarajpoor To avoid divide by zero, can we do this instead:
or
And then we can remove/omit the comment about divide by zero as well |
Good idea! I went with this option, and pushed the changes :) |
Thank you @NimaSarajpoor for this PR! |
This PR fixes issue #890.