deepcharles / ruptures

ruptures: change point detection in Python
BSD 2-Clause "Simplified" License
1.56k stars 161 forks source link

fix: random behaviour of KernelCPD (Pelt) #213

Closed deepcharles closed 2 years ago

deepcharles commented 2 years ago

The C implementation of Pelt (KernelCPD) returned different segmentations when applied several times on the same signal (see #145).

This was because in the C code, we were accessing an address outside of the memory bounds of an array (something like array[-1] instead of array[0]).

I also added a test to verify that KernelCPD always returns the same result on the same signal.