MIT-LCP / MIT-LCP/wfdb-python

ZeroDivisionError in evaluate.py

Open
#278 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Jupyter Notebook
Stars
853
Forks
322
PR merge metrics
No merged PRs in 30d

Description

This is the error I get when trying to run xqrs detection algorithm from Google Colab as well locally.
I have used demo.ipynb from the repo itself.

/usr/local/lib/python3.6/dist-packages/wfdb/processing/evaluate.py in _calc_stats(self)
118 # No tn attribute
119
--> 120 self.sensitivity = float(self.tp) / float(self.tp + self.fn)
121 self.positive_predictivity = float(self.tp) / self.n_test
122

ZeroDivisionError: float division by zero

The error seems very weird in the sense that even when I comment the particular line, the error still shows in the same line.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the traceback from demo.ipynb, then inspect _calc_stats in evaluate.py around the sensitivity and positive_predictivity calculations. Confirm which inputs produce zero denominators and define completion as running the XQRS example without this ZeroDivisionError, with the behavior covered by an appropriate regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.