cdist_soft_dtw and cdist_soft_dtw_normalized return unsquared DTW for gamma=0
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- machine-learning
Research direction
Read the gamma-zero shortcut in _cdist_soft_dtw, where the issue says _cdist_dtw(...) is returned without squaring. Check the tests for cdist_soft_dtw and cdist_soft_dtw_normalized and run the relevant metric tests. Done means both functions return the expected squared DTW values for gamma=0; the issue points to proposed work in #851, so check its status before starting.
Written by the indexing model from the issue text.
Description
With gamma=0, cdist_soft_dtw and cdist_soft_dtw_normalized are documented to return squared DTW, as soft_dtw does, but they return plain DTW distances:
from tslearn.metrics import cdist_soft_dtw, cdist_soft_dtw_normalized
for metric in (cdist_soft_dtw, cdist_soft_dtw_normalized):
print(metric([[0.], [2.]], gamma=0).tolist())
# [[0.0, 2.0], [2.0, 0.0]] for both; expected [[0.0, 4.0], [4.0, 0.0]]
The gamma-zero shortcut in _cdist_soft_dtw returns _cdist_dtw(...) without squaring it. A fix is proposed in #851.
Nathan, ChipLab
- Dominant language
- Python
- Stars
- 3.2k
- Forks
- 418
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 24
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tslearn-team/tslearn
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
tslearn-team/tslearn#854 ·
Maintainers usually reply within 1 day
-
Negative sakoe_chiba_radius is silently accepted: dtw/ctw/frechet return inf and lcss returns 0Possibly taken @MohamedO6 claimed this today. Open
tslearn-team/tslearn#857 ·
Maintainers usually reply within 1 day
-
PAA / SAX / 1d-SAX silently return NaN or garbage when n_segments is larger than the series lengthPossibly taken @MohamedO6 claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 20/100
tslearn-team/tslearn#852 ·
Maintainers usually reply within 1 day
-
arbitrary code execution when loading a model via from_pickle (CWE-502)Possibly taken @ifaizk5 claimed this 4 days ago. Opendocumentation good first issue
Difficulty 5/5 Over a week Newbie friendliness 25/100
tslearn-team/tslearn#820 · 1 comment ·
Maintainers usually reply within 1 day
-
Time series scalers reject ragged lists despite variable-length supportPossibly taken @sunlishuo25 claimed this 62 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 25/100
tslearn-team/tslearn#751 · 1 comment ·
Maintainers usually reply within 1 day
All issues in tslearn-team/tslearn
Similar issues
-
docs(contributing): the two things that silently block a PRPossibly taken A pull request linked to this issue is open or already merged. Openavailable documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Nixitov/Riptide-Native#944 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
JTHCode/secretguard#24 ·
Maintainers usually reply within 1 day
-
area: middleware documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainers usually reply within 1 day