diff --git a/tslearn/metrics/_dtw.py b/tslearn/metrics/_dtw.py index ee45bc25..f2ba8ffa 100644 --- a/tslearn/metrics/_dtw.py +++ b/tslearn/metrics/_dtw.py @@ -713,7 +713,7 @@ def cdist_dtw( Above 50, the output is sent to stdout. The frequency of the messages increases with the verbosity level. If it more than 10, all iterations are reported. - `Glossary `__ + `Glossary `__ for more details. be : Backend object or string or None diff --git a/tslearn/metrics/_frechet.py b/tslearn/metrics/_frechet.py index 477ba9a7..fb4f956e 100644 --- a/tslearn/metrics/_frechet.py +++ b/tslearn/metrics/_frechet.py @@ -719,7 +719,7 @@ def cdist_frechet( Above 50, the output is sent to stdout. The frequency of the messages increases with the verbosity level. If it more than 10, all iterations are reported. - `Glossary `__ + `Glossary `__ for more details. be : Backend object or string or None diff --git a/tslearn/metrics/_gak.py b/tslearn/metrics/_gak.py index 3b104987..c5c45ca3 100644 --- a/tslearn/metrics/_gak.py +++ b/tslearn/metrics/_gak.py @@ -423,7 +423,7 @@ def cdist_gak( Above 50, the output is sent to stdout. The frequency of the messages increases with the verbosity level. If it more than 10, all iterations are reported. - `Glossary `__ + `Glossary `__ for more details. be : Backend object or string or None Backend. If `be` is an instance of the class `NumPyBackend` or the string `"numpy"`, diff --git a/tslearn/metrics/_soft_dtw.py b/tslearn/metrics/_soft_dtw.py index c35760b8..9b86b995 100644 --- a/tslearn/metrics/_soft_dtw.py +++ b/tslearn/metrics/_soft_dtw.py @@ -819,7 +819,7 @@ def cdist_soft_dtw( Above 50, the output is sent to stdout. The frequency of the messages increases with the verbosity level. If it more than 10, all iterations are reported. - `Glossary `__ + `Glossary `__ for more details. be : Backend object or string or None (default: None) @@ -1040,7 +1040,7 @@ def cdist_soft_dtw_normalized( Above 50, the output is sent to stdout. The frequency of the messages increases with the verbosity level. If it more than 10, all iterations are reported. - `Glossary `__ + `Glossary `__ for more details. be : Backend object or string or None (default: None) diff --git a/tslearn/metrics/ctw.py b/tslearn/metrics/ctw.py index 766ab0dd..d10c1c9b 100644 --- a/tslearn/metrics/ctw.py +++ b/tslearn/metrics/ctw.py @@ -364,14 +364,14 @@ def cdist_ctw( The number of jobs to run in parallel. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See scikit-learn's - `Glossary `__ + `Glossary `__ for more details. verbose : int, optional (default=0) The verbosity level: if non zero, progress messages are printed. Above 50, the output is sent to stdout. The frequency of the messages increases with the verbosity level. If it more than 10, all iterations are reported. - `Glossary `__ + `Glossary `__ for more details. be : Backend object or string or None Backend. If `be` is an instance of the class `NumPyBackend` or the string `"numpy"`, diff --git a/tslearn/metrics/dtw_variants.py b/tslearn/metrics/dtw_variants.py index ed1dc719..80cb11b9 100644 --- a/tslearn/metrics/dtw_variants.py +++ b/tslearn/metrics/dtw_variants.py @@ -145,9 +145,11 @@ def _limited_warping_length_cost(s1, s2, max_length, be=None): for j in range(1, s2.shape[0]): min_s = max(i, j) max_s = _max_steps(i, j, max_length - 1, s1.shape[0], s2.shape[0]) + if min_s > max_s: + continue + local_cost = _local_squared_dist(s1[i], s2[j], be=be) for s in range(min_s, max_s + 1): - dict_costs[i, j][s] = _local_squared_dist(s1[i], s2[j], be=be) - dict_costs[i, j][s] += min( + dict_costs[i, j][s] = local_cost + min( dict_costs[i, j - 1].get(s - 1, be.inf), dict_costs[i - 1, j].get(s - 1, be.inf), dict_costs[i - 1, j - 1].get(s - 1, be.inf), diff --git a/tslearn/metrics/sax.py b/tslearn/metrics/sax.py index c1eae00f..9137f36b 100644 --- a/tslearn/metrics/sax.py +++ b/tslearn/metrics/sax.py @@ -52,7 +52,7 @@ def cdist_sax( Above 50, the output is sent to stdout. The frequency of the messages increases with the verbosity level. If it more than 10, all iterations are reported. - `Glossary `__ + `Glossary `__ for more details. Returns diff --git a/tslearn/metrics/utils.py b/tslearn/metrics/utils.py index 087ae433..3fe1cb36 100644 --- a/tslearn/metrics/utils.py +++ b/tslearn/metrics/utils.py @@ -97,7 +97,7 @@ def _cdist_generic( Above 50, the output is sent to stdout. The frequency of the messages increases with the verbosity level. If it more than 10, all iterations are reported. - `Glossary `__ + `Glossary `__ for more details. be : Backend object or string or None diff --git a/tslearn/neighbors/neighbors.py b/tslearn/neighbors/neighbors.py index 34e2e07e..b88d4fa3 100644 --- a/tslearn/neighbors/neighbors.py +++ b/tslearn/neighbors/neighbors.py @@ -485,7 +485,7 @@ class (default: 'dtw') Above 50, the output is sent to stdout. The frequency of the messages increases with the verbosity level. If it more than 10, all iterations are reported. - `Glossary `__ + `Glossary `__ for more details. Notes @@ -625,7 +625,7 @@ class (default: 'dtw') Above 50, the output is sent to stdout. The frequency of the messages increases with the verbosity level. If it more than 10, all iterations are reported. - `Glossary `__ + `Glossary `__ for more details. Examples