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

Fix typo in KernelSegmenter #6835

Merged

Conversation

DonFreed
Copy link
Contributor

This seems to be a simple typo. The minimal data to calculate the segmentation cost should be 2 * windowSize, rather than windowSize, as the error message indicates.

In the current logic, the segmentation cost at a particular point is calculated as the difference between the sum of costs of two windows to the left and right of that point and the cost of a big window of size 2 * windowSize. If the # of the data points is less than the 2 * windowSize, the cost for the full window will be wrong in the circular buffer representation; it will get the wrong cost of a window of size 2 * windowSize - data_size, instead.

Copy link
Contributor

@samuelklee samuelklee left a comment

Choose a reason for hiding this comment

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

Thanks for catching this!

@samuelklee samuelklee merged commit 04f2ee7 into broadinstitute:master Sep 22, 2020
@DonFreed DonFreed deleted the df_kernelsegmenter_windowsize branch September 22, 2020 16:00
mwalker174 pushed a commit that referenced this pull request Nov 3, 2020
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.

2 participants