Closed tdhock closed 2 years ago
Hi,
Thanks for raising this issue. Here, the min_size
(minimum segment length) is not handled correctly, resulting in bad segmentations without raising a BadSegmentation error. We will correct it.
Hi @tdhock ,
Indeed, and we have to address it !
But, just so you know, if you use a min_size
>= 2, then you have the expected results for the given min_size
.
Here, the misbehaviour is due to the fact that, from the user perspective you think you have a min_size
to 1, but in really it is overwritten by the minimum value for a given cost (here L2).
See here for the minimum value for L2 cost.
See here for the place where the set value (you set value to 1) is overwritten to 2.
Hope it helps !
ok, but for the l2 cost (square loss change in normal mean, constant variance) the min_size can be 1, so I still expect a valid segmentation should be returned (not an exception).
Closing the issue since it has been addressed in https://github.com/deepcharles/ruptures/pull/255
Hi @deepcharles thanks for putting your implementation of binary segmentation online. I am trying to use it to compute the full path of binary segmentation models, but the predict method is giving me an exception for large numbers of breakpoints, and incorrect changepoints for small numbers of breakpoints. Here is a small data example:
In this case there are four data points. I expected the first change to be after the second data point, etc (as shown in expected_break_dict above). Instead I got the results in computed_break_dict, which are not expected: