Closed christina-l-cleveland closed 1 year ago
Hi,
can you share the line of code that you use? There is indeed one problem with min_size for some methods.
sure! roughly the code is
rupture_model = rpt.KernelCPD(kernel=kernel, min_size=min_size)
seg_brkpts = rupture_model.fit_predict(seg_values, pen=penalty)
where kernel="rbf", min_size=1, penalty=2 though I tried a very low penalty out of curiosity (0.00001) and still only achieved segments of minimum size 2. is it not possible with the gaussian kernel to create a segment of min_size<2?
Thanks, there is a bug in the min_size is handled. Basically, rupture_model.min_size
is 2 even if you set min_size=1
in the argument. Try doing
rupture_model = rpt.KernelCPD(kernel=kernel, min_size=min_size)
rupture_model.min_size = 1 # force min_size to be 1
seg_brkpts = rupture_model.fit_predict(seg_values, pen=penalty)
that worked! Thanks a lot!
It should be fixed (#270) in the next version (1.1.8).
Hello!
I was hoping to identify segments of down to 1 point in size with kernel change point detection but no matter how low I drop the penalty, the minimum segment size I observe is 2. Is this a feature of kernel change point detection? that a segment of 1 is basically not possible?