sakoe_chiba_mask#
- tslearn.metrics.sakoe_chiba_mask(sz1, sz2, radius=1, be=None)[source]#
Compute the Sakoe-Chiba mask.
- Parameters:
- sz1int
The size of the first time series
- sz2int
The size of the second time series.
- radiusint
The radius of the band.
- beBackend object or string or None
Backend. If be is an instance of the class NumPyBackend or the string “numpy”, the NumPy backend is used. If be is an instance of the class PyTorchBackend or the string “pytorch”, the PyTorch backend is used. If be is None, the backend is determined by the input arrays. See our dedicated user-guide page for more information.
- Returns:
- maskarray-like, shape=(sz1, sz2)
Sakoe-Chiba mask.
Examples
>>> sakoe_chiba_mask(4, 4, radius=2) array([[ True, True, True, False], [ True, True, True, True], [ True, True, True, True], [False, True, True, True]])