cdist_soft_dtw and cdist_soft_dtw_normalized return unsquared DTW for gamma=0

オープン
#855 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Python
スター
3.2k
フォーク
418
平均マージ
2日 14時間
マージ済み PR(30日)
24

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tslearn-team/tslearn のほかの issue

tslearn-team/tslearn の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。