Skip to content

Commit

Permalink
Bugfix in plotSampleScoring
Browse files Browse the repository at this point in the history
Sampling frequency was not correclty handled
+ add Badge in Readme
  • Loading branch information
danjjl committed Jun 12, 2023
1 parent ac8c508 commit 77dc1f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Library for measuring performance of time series classification

![PyPI](https://img.shields.io/pypi/v/timescoring?style=flat-square)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/esl-epfl/epilepsy_performance_metrics/python-app.yml?label=unittest&style=flat-square)

## Motivation

For temporal and sequential data (e.g. in biomedical applications), standard performance evaluation metrics, such as sensitivity and specificity, may not always be the most appropriate and can even be misleading. Evaluation metrics must ultimately reflect the needs of users and also be sufficiently sensitive to guide algorithm development.
Expand Down Expand Up @@ -114,4 +117,4 @@ print("# Event scoring\n" +
"- FP/24h : {:.2f} \n".format(scores.fpRate))
```

A presentation explaining these metrics is available [here](https://drive.google.com/file/d/1-k6i2jVpU7bzqnV6zQPUKlfPkO7qaXau/view?usp=sharing).
A presentation explaining these metrics is available [here](https://drive.google.com/file/d/1-k6i2jVpU7bzqnV6zQPUKlfPkO7qaXau/view?usp=sharing).
5 changes: 4 additions & 1 deletion src/timescoring/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ def plotSampleScoring(ref: Annotation, hyp: Annotation, fs: int = 1) -> plt.figu
"""

score = scoring.SampleScoring(ref, hyp, fs)
time = np.arange(len(ref.mask)) / fs
time = np.arange(len(score.tpMask)) / fs
# Resample Data
ref = Annotation(ref.events, fs, round(len(ref.mask) / ref.fs * fs))
hyp = Annotation(hyp.events, fs, round(len(hyp.mask) / hyp.fs * fs))

fig = plt.figure(figsize=(16, 3))

Expand Down

0 comments on commit 77dc1f7

Please sign in to comment.