ermshaua / claspy

ClaSPy: A Python package for time series segmentation.
BSD 3-Clause "New" or "Revised" License
74 stars 3 forks source link

Different shapes of clasp.py score (self.profile) and input signal #3

Closed kikatuso closed 1 year ago

kikatuso commented 1 year ago

I would like to match the clasp.py profile score with the input signal - however they are of the different size - clasp score is a slightly shorter array than the input signal. How can one know which points from the signal does each score point correspond to?

ermshaua commented 1 year ago

ClaSP computes its profile based on a sliding window representation of the input signal. The sliding window has a size of n-w+1 data points, for an input signal of size n and a window size w.

The corresponding profile also has the size n-w+1 and a given point i in it represents the window starting at the i-th position in the input signal. By design, the last w-1 data points in the input signal cannot represent a valid window (of size w) and are therefore excluded.

You can access the profile and window size from the BinaryClaSPSegmentation object.