Skip to content

tslearn/dtw-mismatched-constraint

Pack Severity Fix Versions
tslearn warning none, edit by hand All versions

tslearn.metrics._masks._compute_mask_generic dispatches solely on global_constraint once it is set. Passing sakoe_chiba_radius with global_constraint="itakura" (or itakura_max_slope with global_constraint="sakoe_chiba") silently drops the mismatched parameter and uses the default slope (2.0) or default radius (1).

dist = dtw(s1, s2, global_constraint="itakura", sakoe_chiba_radius=2)
dist = dtw(s1, s2, global_constraint="sakoe_chiba", sakoe_chiba_radius=2)

Calls to tslearn.metrics warping functions that pair global_constraint="itakura" (or 1) with a non-None sakoe_chiba_radius, or global_constraint="sakoe_chiba" (or 2) with a non-None itakura_max_slope.

Match global_constraint to the constraint parameter you pass, or remove the unused constraint argument.

global_constraint does not match the constraint parameter passed to tslearn, so the mismatched sakoe_chiba_radius or itakura_max_slope argument is silently ignored.

See all rules in the tslearn pack.