Skip to content

fix(ecg): count default false positives - #86

Open
dnncha wants to merge 2 commits into
scientisst:mainfrom
dnncha:fix/ecg-default-false-positives
Open

dnncha wants to merge 2 commits into
scientisst:mainfrom
dnncha:fix/ecg-default-false-positives

Conversation

@dnncha

@dnncha dnncha commented Sep 30, 2026

Copy link
Copy Markdown

Why

compare_segmentation() converts the default minRR=None to infinity. After the first match, every unmatched detection then enters the short-RR suppression path and is omitted from the false-positive count. Keep None as no filter and apply suppression only when the caller provides minRR.

Fixes #85.

Scope

  • Count unmatched detections as false positives when minRR is omitted.
  • Preserve the existing short-RR filter for explicit minRR values.
  • Add focused coverage for both paths.

Blast Radius

This changes the default false-positive count, acc, and err from compare_segmentation(). True-positive counts and sensitivity remain unchanged, and explicit minRR behavior remains available. The public-data replay establishes changed benchmark values on one ECG record, but no affected publication or clinical conclusion was identified. This correction has not received independent human scientific review.

Verification

  • .venv/bin/python -m pytest -q tests/test_ecg_compare_segmentation.py passed both focused tests.
  • On ten minutes of MIT-BIH record 108, false-positive counts from five BioSPPy segmenters matched wfdb.processing.compare_annotations after the fix.
  • The perfect-match and explicit-minRR controls retained TP=3 and FP=0.
  • .venv/bin/python -m compileall -q biosppy tests passed.

@sofia3ms sofia3ms self-assigned this Oct 18, 2026
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.

compare_segmentation undercounts false positives with default minRR

2 participants