Skip to content

Describe the peak calling in ratio_consistent_peaks as implemented - #132

Merged
LuLeom merged 4 commits into
mainfrom
fix-ratio-consistent-peaks-docs
Jul 30, 2026
Merged

Describe the peak calling in ratio_consistent_peaks as implemented#132
LuLeom merged 4 commits into
mainfrom
fix-ratio-consistent-peaks-docs

Conversation

@rcannood

Copy link
Copy Markdown
Member

Describe your changes

The description of ratio_consistent_peaks doesn't match what the component does, which matters here because those thresholds effectively are the metric.

The description says:

For peak calling, the prominence parameter is set to 0.1 and the height parameter is set to 0.05*max_density.

but helper.py uses height = 0.1 and prominence = 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:

  • Dropped persistent_peak_count() from helper.py and the scikit-tda setup dependency from the config. The function is never called, but from ripser import ripser at module level meant the metric image had to carry the whole package. It's recoverable from git history if it's wanted later.
  • Moved the matplotlib/seaborn imports into the if plot: branch, they're only used when debugging locally.
  • The warning for the zero-variance edge case said "Automatic to case 3" while incrementing 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:

    • Breaking changes
    • New functionality
    • Major changes
    • Minor changes
    • Bug fixes
  • Proposed changes are described in the CHANGELOG.md

  • CI Tests succeed and look good!

* 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
@rcannood
rcannood requested review from LuLeom and ghar1821 July 28, 2026 11:24
@LuLeom
LuLeom merged commit 0bedc41 into main Jul 30, 2026
2 checks passed
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.

3 participants