tslearn/dbscan-unnormalized-softdtw
| Pack | Severity | Fix | Versions |
|---|---|---|---|
| tslearn | error | safe, with xpd check --fix |
All versions |
Unlike TimeSeriesKMeans and KNeighborsTimeSeries, TimeSeriesDBSCAN requires non-negative distances for eps-radius neighborhoods and raises ValueError when metric="softdtw" is passed. Use metric="softdtw_normalized" instead.
db = TimeSeriesDBSCAN(eps=2.0, min_ts=3, metric="softdtw")db = TimeSeriesDBSCAN(eps=2.0, min_ts=3, metric="softdtw_normalized")What the rule reports
Section titled “What the rule reports”TimeSeriesDBSCAN(...) calls passing metric="softdtw".
How to fix it
Section titled “How to fix it”Replace metric="softdtw" with metric="softdtw_normalized" (or another supported metric: "dtw", "ctw", "frechet", "euclidean", or "precomputed").
Diagnostic message
Section titled “Diagnostic message”TimeSeriesDBSCAN rejects metric="softdtw" with ValueError because unnormalized soft-DTW can be negative. Pass metric="softdtw_normalized" instead.See all rules in the tslearn pack.