deepcharles / ruptures

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

CostAR modifies signal in-place #162

Closed robert-lieck closed 3 years ago

robert-lieck commented 3 years ago

Using CostAR with Pelt (I assume also with other search methods) modifies the provided signal in-place. That is, when providing a numpy array as a signal, the original data will be manipulated. Of course, making an explicit copy of the data before calling fit prevents this, but I feel this should not be expected or be very prominently mentioned in the documentation.

To give you an idea, here is a screen shot. I looks like the first couple of points are replaced by their mean or something:

image

deepcharles commented 3 years ago

Hello,

Indeed this is bad practice. I'll look into that. Thanks

robert-lieck commented 3 years ago

Oh, that's why your issues list is so short... 😄 Impressive time to respond and fix, many thanks!

Great library by the way and very useful for the evaluation of new methods. Hope to be able to express my gratitude by providing another citation shortly 😉