Describe the peak calling in ratio_consistent_peaks as implemented - #132
Merged
Conversation
* Document the standardisation step and the actual height/prominence thresholds * Drop persistent_peak_count() and the scikit-tda dependency, it was never called * Only import matplotlib and seaborn when actually plotting * Say case 2 where the code means case 2
ghar1821
approved these changes
Jul 30, 2026
LuLeom
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
The description of
ratio_consistent_peaksdoesn't match what the component does, which matters here because those thresholds effectively are the metric.The description says:
but
helper.pyusesheight = 0.1andprominence = 0.01, both as absolute values rather than relative to the max density. The description also doesn't mention that the two splits are standardised together on the pooled mean/sd before the KDE, which is what makes an absolute height threshold meaningful in the first place.I've updated the description to match the code rather than the other way around, since changing the thresholds would change every score. If the described behaviour (prominence 0.1, height relative to max density) was the intent, that's worth doing as a separate PR so we can see the effect on the scores -- happy to open one, just let me know.
While in there:
persistent_peak_count()fromhelper.pyand thescikit-tdasetup dependency from the config. The function is never called, butfrom ripser import ripserat module level meant the metric image had to carry the whole package. It's recoverable from git history if it's wanted later.matplotlib/seabornimports into theif plot:branch, they're only used when debugging locally.n_case2, and the comment block above the loop used the old case numbering. Both now say case 2.No behaviour changes.
Found while reviewing the task ahead of the next full benchmark run -- see also the sibling PRs.
Checklist before requesting a review
I have performed a self-review of my code
Check the correct box. Does this PR contain:
Proposed changes are described in the CHANGELOG.md
CI Tests succeed and look good!