[ENH] RandomShapeletTransform speed ups#3574
Conversation
Thank you for contributing to
|
| for i, n in zip(shapelet, subseq): | ||
| temp = i - n | ||
| for i in range(length): | ||
| val = (series[position + i] - mean) / std if use_std else 0.0 |
There was a problem hiding this comment.
Is this fast? I.e. calling the 'if' on every value?
maybe first do normalization in a different loop if use_std is set ?
or divide by std=1.0 ? and set std = 1 if use_std is set?
| use_std = std > AEON_NUMBA_STD_THRESHOLD | ||
| for j in range(length): | ||
| idx = sorted_indicies[j] | ||
| val = (series[pos + idx] - mean) / std if use_std else 0 |
There was a problem hiding this comment.
maybe more efficient to do this once outside and use the normalized values here?
patrickzib
left a comment
There was a problem hiding this comment.
Not a review, just a comment. Maybe calling if on every value is not super efficient? normalization once outside the loops or using / std=1.0 might be faster?
sequence of computational improvements designed to speed up RST without changing outcome.
Stage 1: _online_shapelet_distance scalar rewrite
Replace traverse, sums, and sums2 list state with scalar left/right state
compute the normalised value on demand, avoid unnecessary slicing
Move unchanging values out of loop