forked from TDAmeritrade/stumpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstimp.py
726 lines (605 loc) · 26.4 KB
/
stimp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
# STUMPY
# Copyright 2019 TD Ameritrade. Released under the terms of the 3-Clause BSD license.
# STUMPY is a trademark of TD Ameritrade IP Company, Inc. All rights reserved.
import numpy as np
from . import core, scrump
from .aamp_stimp import aamp_stimp, aamp_stimped
from .stump import stump
from .stumped import stumped
def _normalize_pan(pan, ms, bfs_indices, n_processed):
"""
Normalize the pan matrix profile nearest neighbor distances (inplace) relative
to the corresponding subsequence length from which they were computed
Parameters
----------
pan : numpy.ndarray
The pan matrix profile
ms : numpy.ndarray
The breadth-first-search sorted subsequence window sizes
bfs_indices : numpy.ndarray
The breadth-first-search indices
n_processed : numpy.ndarray
The number of subsequence window sizes and breadth-first-search indices to
normalize
Returns
-------
None
"""
idx = bfs_indices[:n_processed]
norm = 1.0 / (2.0 * np.sqrt(ms[:n_processed]))
pan[idx] = np.minimum(1.0, pan[idx] * np.expand_dims(norm, 1))
class _stimp:
"""
Compute the Pan Matrix Profile
This is based on the SKIMP algorithm.
Parameters
----------
T : numpy.ndarray
The time series or sequence for which to compute the pan matrix profile
min_m : int, default 3
The starting (or minimum) subsequence window size for which a matrix profile
may be computed
max_m : int, default None
The stopping (or maximum) subsequence window size for which a matrix profile
may be computed. When `max_m = None`, this is set to the maximum allowable
subsequence window size
step : int, default 1
The step between subsequence window sizes
percentage : float, default 0.01
The percentage of the full matrix profile to compute for each subsequence
window size. When `percentage < 1.0`, then the `scrump` algorithm is used.
Otherwise, the `stump` algorithm is used when the exact matrix profile is
requested.
pre_scrump : bool, default True
A flag for whether or not to perform the PreSCRIMP calculation prior to
computing SCRIMP. If set to `True`, this is equivalent to computing
SCRIMP++. This parameter is ignored when `percentage = 1.0`.
client : client, default None
A Dask or Ray Distributed client. Setting up a distributed cluster is beyond
the scope of this library. Please refer to the Dask or Ray Distributed
documentation.
device_id : int or list, default None
The (GPU) device number to use. The default value is `0`. A list of
valid device ids (``int``) may also be provided for parallel GPU-STUMP
computation. A list of all valid device ids can be obtained by
executing `[device.id for device in numba.cuda.list_devices()]`.
mp_func : function, default stump
The matrix profile function to use when `percentage = 1.0`
T_subseq_isconstant_func : function, default None
A custom, user-defined function that returns a boolean array that indicates
whether a subsequence in `T` is constant (True). The function must only take
two arguments, `a`, a 1-D array, and `w`, the window size, while additional
arguments may be specified by currying the user-defined function using
`functools.partial`. Any subsequence with at least one np.nan/np.inf will
automatically have its corresponding value set to False in this boolean array.
Attributes
----------
PAN_ : numpy.ndarray
The transformed (i.e., normalized, contrasted, binarized, and repeated)
pan matrix profile
M_ : numpy.ndarray
The full list of (breadth first search (level) ordered) subsequence window
sizes
Methods
-------
update():
Compute the next matrix profile using the next available (breadth-first-search
(level) ordered) subsequence window size and update the pan matrix profile
Notes
-----
`DOI: 10.1109/ICBK.2019.00031 \
<https://www.cs.ucr.edu/~eamonn/PAN_SKIMP%20%28Matrix%20Profile%20XX%29.pdf>`__
See Table 2
"""
def __init__(
self,
T,
min_m=3,
max_m=None,
step=1,
percentage=0.01,
pre_scrump=True,
client=None,
device_id=None,
mp_func=stump,
T_subseq_isconstant_func=None,
):
"""
Initialize the `stimp` object and compute the Pan Matrix Profile
Parameters
----------
T : numpy.ndarray
The time series or sequence for which to compute the pan matrix profile
min_m : int, default 3
The minimum subsequence window size to consider computing a matrix profile
for
max_m : int, default None
The maximum subsequence window size to consider computing a matrix profile
for. When `max_m = None`, this is set to the maximum allowable subsequence
window size
step : int, default 1
The step between subsequence window sizes
percentage : float, default 0.01
The percentage of the full matrix profile to compute for each subsequence
window size. When `percentage < 1.0`, then the `scrump` algorithm is used.
Otherwise, the `stump` algorithm is used when the exact matrix profile is
requested.
pre_scrump : bool, default True
A flag for whether or not to perform the PreSCRIMP calculation prior to
computing SCRIMP. If set to `True`, this is equivalent to computing
SCRIMP++. This parameter is ignored when `percentage = 1.0`.
client : client, default None
A Dask or Ray Distributed client. Setting up a distributed cluster is beyond
the scope of this library. Please refer to the Dask or Ray Distributed
documentation.
device_id : int or list, default None
The (GPU) device number to use. The default value is `0`. A list of
valid device ids (``int``) may also be provided for parallel GPU-STUMP
computation. A list of all valid device ids can be obtained by
executing `[device.id for device in numba.cuda.list_devices()]`.
mp_func : function, default stump
The matrix profile function to use when `percentage = 1.0`
T_subseq_isconstant_func : function, default None
A custom, user-defined function that returns a boolean array that indicates
whether a subsequence in `T` is constant (True). The function must only take
two arguments, `a`, a 1-D array, and `w`, the window size, while additional
arguments may be specified by currying the user-defined function using
`functools.partial`. Any subsequence with at least one np.nan/np.inf will
automatically have its corresponding value set to False in this boolean
array.
"""
self._T = T.copy()
if max_m is None:
max_m = max(min_m + 1, core.get_max_window_size(self._T.shape[0]))
M = np.arange(min_m, max_m + 1, step).astype(np.int64)
else:
min_m, max_m = sorted([min_m, max_m])
M = np.arange(
max(3, min_m),
min(core.get_max_window_size(self._T.shape[0]), max_m) + 1,
step,
).astype(np.int64)
self._bfs_indices = core._bfs_indices(M.shape[0])
self._M = M[self._bfs_indices]
self._n_processed = 0
percentage = np.clip(percentage, 0.0, 1.0)
self._percentage = percentage
self._pre_scrump = pre_scrump
self._partial_mp_func = core._get_partial_mp_func(
mp_func, client=client, device_id=device_id
)
if T_subseq_isconstant_func is None:
T_subseq_isconstant_func = core._rolling_isconstant
if not callable(T_subseq_isconstant_func): # pragma: no cover
msg = (
"`T_subseq_isconstant_func` was expected to be a callable function "
+ f"but {type(T_subseq_isconstant_func)} was found."
)
raise ValueError(msg)
self._T_subseq_isconstant_func = T_subseq_isconstant_func
self._PAN = np.full(
(self._M.shape[0], self._T.shape[0]), fill_value=np.inf, dtype=np.float64
)
def update(self):
"""
Update the pan matrix profile by computing a single matrix profile using the
next available subsequence window size
Parameters
----------
None
Returns
-------
None
Notes
-----
`DOI: 10.1109/ICBK.2019.00031 \
<https://www.cs.ucr.edu/~eamonn/PAN_SKIMP%20%28Matrix%20Profile%20XX%29.pdf>`__
See Table 2
"""
if self._n_processed < self._M.shape[0]:
m = self._M[self._n_processed]
if self._percentage < 1.0:
approx = scrump(
self._T,
m,
ignore_trivial=True,
percentage=self._percentage,
pre_scrump=self._pre_scrump,
k=1,
T_A_subseq_isconstant=self._T_subseq_isconstant_func,
)
approx.update()
self._PAN[
self._bfs_indices[self._n_processed], : approx.P_.shape[0]
] = approx.P_
else:
out = self._partial_mp_func(
self._T,
m,
ignore_trivial=True,
T_A_subseq_isconstant=self._T_subseq_isconstant_func,
)
self._PAN[
self._bfs_indices[self._n_processed], : out[:, 0].shape[0]
] = out[:, 0]
self._n_processed += 1
def pan(self, threshold=0.2, normalize=True, contrast=True, binary=True, clip=True):
"""
Generate a transformed (i.e., normalized, contrasted, binarized, and repeated)
pan matrix profile
Parameters
----------
threshold : float, default 0.2
The distance `threshold` in which to center the pan matrix profile around
for best contrast and this value is also used for binarizing the pan matrix
profile
normalize : bool, default True
A flag for whether or not each individual matrix profile within the pan
matrix profile is normalized by its corresponding subsequence window size.
If set to `True`, normalization is performed.
contrast : bool, default True
A flag for whether or not the pan matrix profile is centered around the
desired `threshold` in order to provide higher contrast. If set to `True`,
centering is performed.
binary : bool, default True
A flag for whether or not the pan matrix profile is binarized. If set to
`True`, all values less than or equal to `threshold` are set to `0.0` while
all other values are set to `1.0`.
clip : bool, default True
A flag for whether or not the pan matrix profile is clipped. If set to
`True`, all values are ensured to be clipped between `0.0` and `1.0`.
Returns
-------
None
"""
PAN = self._PAN.copy()
# Retrieve the row indices where the matrix profile was actually computed
idx = self._bfs_indices[: self._n_processed]
sorted_idx = np.sort(idx)
PAN[PAN == np.inf] = np.nan
if normalize:
_normalize_pan(PAN, self._M, self._bfs_indices, self._n_processed)
if contrast:
core._contrast_pan(PAN, threshold, self._bfs_indices, self._n_processed)
if binary:
core._binarize_pan(PAN, threshold, self._bfs_indices, self._n_processed)
if clip:
PAN[idx] = np.clip(PAN[idx], 0.0, 1.0)
# Below, for each matrix profile that was computed, we take that matrix profile
# and copy/repeat it downwards to replace other rows in the `PAN` where the
# matrix profile has yet to be computed. Instead of only having lines/values in
# the rows where matrix profiles were computed, this gives us the "blocky" look
nrepeat = np.diff(np.append(-1, sorted_idx))
PAN[: np.sum(nrepeat)] = np.repeat(PAN[sorted_idx], nrepeat, axis=0)
PAN[np.isnan(PAN)] = np.nanmax(PAN)
return PAN
@property
def PAN_(self):
"""
Get the transformed (i.e., normalized, contrasted, binarized, and repeated) pan
matrix profile
Parameters
----------
None
Returns
-------
None
"""
return self.pan().astype(np.float64)
@property
def M_(self):
"""
Get all of the (breadth first searched (level) ordered) subsequence window sizes
Parameters
----------
None
Returns
-------
None
"""
return self._M.astype(np.int64)
# @property
# def bfs_indices_(self):
# """
# Get the breadth first search (level order) indices
# """
# return self._bfs_indices.astype(np.int64)
# @property
# def n_processed_(self): # pragma: no cover
# """
# Get the total number of windows that have been processed
# """
# return self._n_processed
@core.non_normalized(
aamp_stimp,
exclude=["pre_scrump", "normalize", "p", "T_subseq_isconstant_func", "pre_scraamp"],
replace={"pre_scrump": "pre_scraamp"},
)
class stimp(_stimp):
"""
A class to compute the Pan Matrix Profile
This is based on the SKIMP algorithm.
Parameters
----------
T : numpy.ndarray
The time series or sequence for which to compute the pan matrix profile.
min_m : int, default 3
The starting (or minimum) subsequence window size for which a matrix profile
may be computed.
max_m : int, default None
The stopping (or maximum) subsequence window size for which a matrix profile
may be computed. When ``max_m = None``, this is set to the maximum allowable
subsequence window size.
step : int, default 1
The step between subsequence window sizes.
percentage : float, default 0.01
The percentage of the full matrix profile to compute for each subsequence
window size. When ``percentage < 1.0``, then the ``scrump`` algorithm is used.
Otherwise, the ``stump`` algorithm is used when the exact matrix profile is
requested.
pre_scrump : bool, default True
A flag for whether or not to perform the PreSCRIMP calculation prior to
computing SCRIMP. If set to ``True``, this is equivalent to computing
SCRIMP++. This parameter is ignored when ``percentage = 1.0``.
normalize : bool, default True
When set to ``True``, this z-normalizes subsequences prior to computing
distances. Otherwise, this function gets re-routed to its complementary
non-normalized equivalent set in the ``@core.non_normalized`` function
decorator.
p : float, default 2.0
The p-norm to apply for computing the Minkowski distance. Minkowski distance is
typically used with ``p`` being ``1`` or ``2``, which correspond to the
Manhattan distance and the Euclidean distance, respectively. This parameter is
ignored when ``normalize == True``.
T_subseq_isconstant_func : function, default None
A custom, user-defined function that returns a boolean array that indicates
whether a subsequence in ``T`` is constant (``True``). The function must only
take two arguments, ``a``, a 1-D array, and ``w``, the window size, while
additional arguments may be specified by currying the user-defined function
using ``functools.partial``. Any subsequence with at least one
``np.nan``/``np.inf`` will automatically have its corresponding value set to
``False`` in this boolean array.
Attributes
----------
PAN_ : numpy.ndarray
The transformed (i.e., normalized, contrasted, binarized, and repeated)
pan matrix profile.
M_ : numpy.ndarray
The full list of (breadth first search (level) ordered) subsequence window
sizes.
Methods
-------
update():
Compute the next matrix profile using the next available (breadth-first-search
(level) ordered) subsequence window size and update the pan matrix profile
See Also
--------
stumpy.stimped : Compute the Pan Matrix Profile with a ``dask``/``ray`` cluster
stumpy.gpu_stimp : Compute the Pan Matrix Profile with with one or more GPU devices
Notes
-----
`DOI: 10.1109/ICBK.2019.00031 \
<https://www.cs.ucr.edu/~eamonn/PAN_SKIMP%20%28Matrix%20Profile%20XX%29.pdf>`__
See Table 2
Examples
--------
>>> import stumpy
>>> import numpy as np
>>> pmp = stumpy.stimp(np.array([584., -11., 23., 79., 1001., 0., -19.]))
>>> pmp.update()
>>> pmp.PAN_
array([[0., 1., 1., 1., 1., 1., 1.],
[0., 1., 1., 1., 1., 1., 1.]])
"""
def __init__(
self,
T,
min_m=3,
max_m=None,
step=1,
percentage=0.01,
pre_scrump=True,
normalize=True,
p=2.0,
T_subseq_isconstant_func=None,
):
"""
Initialize the ``stimp`` object and compute the Pan Matrix Profile
Parameters
----------
T : numpy.ndarray
The time series or sequence for which to compute the pan matrix profile.
min_m : int, default 3
The minimum subsequence window size to consider computing a matrix profile
for.
max_m : int, default None
The maximum subsequence window size to consider computing a matrix profile
for. When ``max_m = None``, this is set to the maximum allowable
subsequence window size.
step : int, default 1
The step between subsequence window sizes.
percentage : float, default 0.01
The percentage of the full matrix profile to compute for each subsequence
window size. When ``percentage < 1.0``, then the ``scrump`` algorithm is
used. Otherwise, the ``stump`` algorithm is used when the exact matrix
profile is requested.
pre_scrump : bool, default True
A flag for whether or not to perform the PreSCRIMP calculation prior to
computing SCRIMP. If set to ``True``, this is equivalent to computing
SCRIMP++. This parameter is ignored when `percentage = 1.0``.
normalize : bool, default True
When set to ``True``, this z-normalizes subsequences prior to computing
distances. Otherwise, this function gets re-routed to its complementary
non-normalized equivalent set in the ``@core.non_normalized`` function
decorator.
p : float, default 2.0
The p-norm to apply for computing the Minkowski distance. This parameter is
ignored when ``normalize == True``.
T_subseq_isconstant_func : function, default None
A custom, user-defined function that returns a boolean array that indicates
whether a subsequence in ``T`` is constant (``True``). The function must
only take two arguments, ``a``, a 1-D array, and ``w``, the window size,
while additional arguments may be specified by currying the user-defined
function using ``functools.partial``. Any subsequence with at least one
``np.nan``/``np.inf`` will automatically have its corresponding value set
to ``False`` in this boolean array.
"""
super().__init__(
T,
min_m=min_m,
max_m=max_m,
step=step,
percentage=percentage,
pre_scrump=pre_scrump,
mp_func=stump,
T_subseq_isconstant_func=T_subseq_isconstant_func,
)
@core.non_normalized(
aamp_stimped,
exclude=["pre_scrump", "normalize", "p", "T_subseq_isconstant_func", "pre_scraamp"],
replace={"pre_scrump": "pre_scraamp"},
)
class stimped(_stimp):
"""
A class to compute the Pan Matrix Profile with a ``dask``/``ray`` cluster
This is based on the SKIMP algorithm.
Parameters
----------
client : client
A ``dask``/``ray`` client. Setting up a ``dask``/``ray`` cluster is beyond
the scope of this library. Please refer to the ``dask``/``ray``
documentation.
T : numpy.ndarray
The time series or sequence for which to compute the pan matrix profile.
min_m : int, default 3
The starting (or minimum) subsequence window size for which a matrix profile
may be computed.
max_m : int, default None
The stopping (or maximum) subsequence window size for which a matrix profile
may be computed. When ``max_m = None``, this is set to the maximum allowable
subsequence window size
step : int, default 1
The step between subsequence window sizes.
normalize : bool, default True
When set to ``True``, this z-normalizes subsequences prior to computing
distances. Otherwise, this function gets re-routed to its complementary
non-normalized equivalent set in the ``@core.non_normalized`` function
decorator.
p : float, default 2.0
The p-norm to apply for computing the Minkowski distance. Minkowski distance is
typically used with ``p`` being ``1`` or ``2``, which correspond to the
Manhattan distance and the Euclidean distance, respectively. This parameter is
ignored when ``normalize == True``.
T_subseq_isconstant_func : function, default None
A custom, user-defined function that returns a boolean array that indicates
whether a subsequence in ``T`` is constant (``True``). The function must
only take two arguments, ``a``, a 1-D array, and ``w``, the window size,
while additional arguments may be specified by currying the user-defined
function using ``functools.partial``. Any subsequence with at least one
``np.nan``/``np.inf`` will automatically have its corresponding value set
to ``False`` in this boolean array.
Attributes
----------
PAN_ : numpy.ndarray
The transformed (i.e., normalized, contrasted, binarized, and repeated)
pan matrix profile.
M_ : numpy.ndarray
The full list of (breadth first search (level) ordered) subsequence window
sizes.
Methods
-------
update():
Compute the next matrix profile using the next available (breadth-first-search
(level) ordered) subsequence window size and update the pan matrix profile.
See Also
--------
stumpy.stimp : Compute the Pan Matrix Profile
stumpy.gpu_stimp : Compute the Pan Matrix Profile with with one or more GPU devices
Notes
-----
`DOI: 10.1109/ICBK.2019.00031 \
<https://www.cs.ucr.edu/~eamonn/PAN_SKIMP%20%28Matrix%20Profile%20XX%29.pdf>`__
See Table 2
Examples
--------
>>> import stumpy
>>> import numpy as np
>>> from dask.distributed import Client
>>> if __name__ == "__main__":
... with Client() as dask_client:
... pmp = stumpy.stimped(
... dask_client,
... np.array([584., -11., 23., 79., 1001., 0., -19.]))
... pmp.update()
... pmp.PAN_
array([[0., 1., 1., 1., 1., 1., 1.],
[0., 1., 1., 1., 1., 1., 1.]])
Alternatively, you can also use `ray`
>>> import ray
>>> if __name__ == "__main__":
>>> ray.init()
>>> pmp = stumpy.stimped(
... ray,
... np.array([584., -11., 23., 79., 1001., 0., -19.]))
>>> ray.shutdown()
"""
def __init__(
self,
client,
T,
min_m=3,
max_m=None,
step=1,
normalize=True,
p=2.0,
T_subseq_isconstant_func=None,
):
"""
Initialize the ``stimp`` object and compute the Pan Matrix Profile
Parameters
----------
client : client
A ``dask``/``ray`` client. Setting up a ``dask``/``ray`` cluster is beyond
the scope of this library. Please refer to the ``dask``/``ray``
documentation.
T : numpy.ndarray
The time series or sequence for which to compute the pan matrix profile.
min_m : int, default 3
The minimum subsequence window size to consider computing a matrix profile
for.
max_m : int, default None
The maximum subsequence window size to consider computing a matrix profile
for. When ``max_m = None``, this is set to the maximum allowable
subsequence window size.
step : int, default 1
The step between subsequence window sizes.
normalize : bool, default True
When set to ``True``, this z-normalizes subsequences prior to computing
distances. Otherwise, this function gets re-routed to its complementary
non-normalized equivalent set in the ``@core.non_normalized`` function
decorator.
p : float, default 2.0
The p-norm to apply for computing the Minkowski distance. Minkowski
distance is typically used with ``p`` being ``1`` or ``2``, which
correspond to the Manhattan distance and the Euclidean distance,
respectively. This parameter is ignored when ``normalize == True``.
T_subseq_isconstant_func : function, default None
A custom, user-defined function that returns a boolean array that indicates
whether a subsequence in ``T`` is constant (``True``). The function must
only take two arguments, ``a``, a 1-D array, and ``w``, the window size,
while additional arguments may be specified by currying the user-defined
function using `functools.partial `. Any subsequence with at least one
``np.nan``/``np.inf`` will automatically have its corresponding value set
to ``False`` in this boolean array.
"""
super().__init__(
T,
min_m=min_m,
max_m=max_m,
step=step,
percentage=1.0,
pre_scrump=False,
client=client,
mp_func=stumped,
T_subseq_isconstant_func=T_subseq_isconstant_func,
)